2
0
Fork 0
mirror of https://github.com/alexanderepstein/Bash-Snippets synced 2018-11-08 02:59:35 +01:00

Changing endpoint in currency conversion

This commit is contained in:
Alex Epstein 2018-09-01 12:47:50 -07:00
parent 0b291d241a
commit b270518de8

View file

@ -136,7 +136,7 @@ checkInternet()
## Grabs the exchange rate and does the math for converting the currency
convertCurrency()
{
exchangeRate=$(httpGet "https://exchangeratesapi.io/api/latest?base=$base&symbols=$base,$exchangeTo" | grep -Eo "[0-9]*[.][0-9]*") > /dev/null
exchangeRate=$(httpGet "https://api.exchangeratesapi.io/latest?base=$base&symbols=$base,$exchangeTo" | grep -Eo "[0-9]*[.][0-9]*") > /dev/null
if ! command -v bc &>/dev/null; then
oldRate=$exchangeRate
exchangeRate=$(echo $exchangeRate | grep -Eo "^[0-9]*" )