Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tianhaoz95/45698d9518a9e715cb4ceb97c079627c to your computer and use it in GitHub Desktop.
Save tianhaoz95/45698d9518a9e715cb4ceb97c079627c to your computer and use it in GitHub Desktop.
#!/bin/sh
TOTAL_HEIGHT=$(curl -s https://rpc-cronos.crypto.org/commit | jq -r ".result.signed_header.header.height")
CURRENT_HEIGHT=$(cronosd status 2>&1 --home $CRONOS_HOME | jq -r '.SyncInfo.latest_block_height')
PROGRESS=$(echo "scale=2; $CURRENT_HEIGHT/$TOTAL_HEIGHT*100" | bc -l)
MSG="Progress $CURRENT_HEIGHT / $TOTAL_HEIGHT ($PROGRESS%)"
echo $MSG
kdeconnect-cli --ping-msg "$MSG" --device "$KDE_NOTIFY_DEVICE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment