Fix bitcoin price script

This commit is contained in:
ItsDrike 2021-10-22 13:19:06 +02:00
parent 900f5f2706
commit c01d292933
No known key found for this signature in database
GPG key ID: FB8CA11A2CF3A843

View file

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
BTC_DATA=$(curl https://api.coindesk.com/v1/bpi/currentprice.json 2>/dev/null | echo 'ERR') BTC_DATA=$(curl https://api.coindesk.com/v1/bpi/currentprice.json 2>/dev/null || echo 'ERR')
if [ "$BTC_DATA" != "ERR" ]; then if [ "$BTC_DATA" != "ERR" ]; then
BTC_PRICE=$(echo $BTC_DATA | jq -r ".bpi.USD.rate_float") BTC_PRICE=$(echo $BTC_DATA | jq -r ".bpi.USD.rate_float")