0xddfc2e10…3e91sent to0x165cd37b…5e14·#16,015,310·view on Etherscan
https://github.com/Floflis/ethgas.git
---------------------------------------------------------------------------------------------------------------------------
/media/daniell/B/git/Floflis/Utilities/ethgas/install.sh ---->
---------------------------------------------------------------------------------------------------------------------------
#!/bin/sh
echo "Installing ethgas..."
sudo cp -f ethgas /usr/bin/ethgas
sudo mkdir /usr/lib/ethgas
sudo cp -f gas-pump.svg /usr/lib/ethgas/gas-pump.svg
sudo cp -f gas-pump-symbolic.svg /usr/share/icons/hicolor/scalable/status/gas-pump-symbolic.svg
installfail(){
echo "Installation has failed."
exit 1
}
if [ -f /usr/bin/ethgas ];then
echo "- Turning ethgas into an executable..."
sudo chmod +x /usr/bin/ethgas
if ethgas babyisalive; then echo "Done! Running 'ethgas' command as example to use it:" && (ethgas &);exit 0; else installfail; fi
else
installfail
fi
---------------------------------------------------------------------------------------------------------------------------
<---- /media/daniell/B/git/Floflis/Utilities/ethgas/install.sh
---------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
/media/daniell/B/git/Floflis/Utilities/ethgas/ethgas ---->
---------------------------------------------------------------------------------------------------------------------------
#!/bin/bash -e
offline_msg="You are offline."
rapidgasget=$(curl -s https://etherchain.org/api/gasnow | jq -r '.data.rapid');rapidgasformat=$(printf "%'d" $rapidgasget)
fastgasget=$(curl -s https://etherchain.org/api/gasnow | jq -r '.data.fast');fastgasformat=$(printf "%'d" $fastgasget)
standardgasget=$(curl -s https://etherchain.org/api/gasnow | jq -r '.data.standard');standardgasformat=$(printf "%'d" $standardgasget)
slowgasget=$(curl -s https://etherchain.org/api/gasnow | jq -r '.data.slow');slowgasformat=$(printf "%'d" $slowgasget)
#ethprice=$(curl -s https://etherchain.org/api/gasnow | jq -r '.data.priceUSD')
#rapidgas_toeth=$(echo "0.1 0.1" | awk '{printf "%.18f\n", $rapidgasget / 1000000000000000000}')
#rapidgas_cost=$(echo "$value + $value"|bc)
if [ "$1" != "" ]
then
if [ "$1" = "gasno" ];then
if online -s; then echo ${fastgasformat%%,*}; else echo "OFF"; fi
fi
if [ "$1" = "icon" ];then
echo "/usr/lib/ethgas/gas-pump.svg"
fi
if [ "$1" = "oneline" ];then
if online -s; then echo "🚀 Rapid: ${rapidgasformat%%,*} | ✈ Fast: ${fastgasformat%%,*} | 🚗 Standard: ${standardgasformat%%,*} | 🛵 Slow: ${slowgasformat%%,*}"; else echo "❌ $offline_msg"; fi
fi
else
gaslines () {
echo "⛽ ETH Gas"
echo "Current gas prices in GWei:"
echo "--------------------------------"
echo "🚀 Rapid: ${rapidgasformat%%,*}"
echo " | 15 Seconds"
echo "--------------------------------"
echo "✈ Fast: ${fastgasformat%%,*}"
echo " | 1 Minute"
echo "--------------------------------"
echo "🚗 Standard: ${standardgasformat%%,*}"
echo " | 3 Minutes"
echo "--------------------------------"
echo "🛵 Slow: ${slowgasformat%%,*}"
echo " | > 10 Minutes"
}
if online -s; then gaslines; else echo "⛽ ETH Gas:";echo "$offline_msg"; fi
fi
if [ "$1" = "babyisalive" ]; then
exit 0
fi
if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then
echo "Use these commands after/together with 'online' command."
echo "Available flags:"
echo " gasno Display only the number of the median gas (GWei) price"
echo " oneline Display all of the gas price options in one line"
echo " icon Returns the dinamic icon to be used (programmatic use)"
echo " --help, -h Shows all available commands"
# echo " --version, -v Shows info about OS name, version and build version"
fi
---------------------------------------------------------------------------------------------------------------------------
<---- /media/daniell/B/git/Floflis/Utilities/ethgas/ethgas
---------------------------------------------------------------------------------------------------------------------------