Browse Source

fixed awk syntax

main
deicidus 2 years ago
parent
commit
cfc1690e6c
  1. 4
      spells/menu/bitcoin/bitcoin-status

4
spells/menu/bitcoin/bitcoin-status

@ -44,7 +44,7 @@ get_status() {
if [ "$sync_status" = "synced" ]; then
install_status="installed, $running_status, synced"
elif [ "$sync_status" = "syncing" ]; then
progress=$(bitcoin-cli getblockchaininfo | grep 'progress' | awk '{print int($2*100)}')
progress=$(bitcoin-cli getblockchaininfo | grep 'progress' | awk -F":" '{gsub(/,/, "", $2); print int($2*100)}')
install_status="installed, $running_status, syncing $progress%"
elif [ "$sync_status" = "unknown" ]; then
install_status="installed, $running_status, not synced"
@ -58,7 +58,7 @@ get_status() {
install_status="not installed"
fi
printf "$(color_for_status "$install_status")$install_status${RESET}\n"
echo "$(color_for_status "$install_status")$install_status${RESET}"
}
get_status
Loading…
Cancel
Save