mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2025-06-29 12:10:42 +00:00
Initial commit
This commit is contained in:
parent
b912871070
commit
a3e01caebf
157 changed files with 9696 additions and 0 deletions
12
home/.local/bin/scripts/cli/bitcoin
Executable file
12
home/.local/bin/scripts/cli/bitcoin
Executable file
|
@ -0,0 +1,12 @@
|
|||
#!/bin/sh
|
||||
|
||||
BTC_DATA=$(curl https://api.coindesk.com/v1/bpi/currentprice.json 2>/dev/null || echo 'ERR')
|
||||
|
||||
if [ "$BTC_DATA" != "ERR" ]; then
|
||||
BTC_PRICE=$(echo $BTC_DATA | jq -r ".bpi.USD.rate_float")
|
||||
BTC_PRICE=$(printf "%.0f" "$BTC_PRICE")
|
||||
echo \$"$BTC_PRICE"
|
||||
else
|
||||
echo "N/A"
|
||||
fi
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue