Created
May 13, 2020 21:31
-
-
Save novy4/fe4e2f86c96530f259e473c147e1bdf6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
WALLET_PASS=$1 | |
AKASH_PATH='/usr/local/bin' | |
WALLET=$(echo -e "$WALLET_PASS\n" | $AKASH_PATH/akashctl keys list -n) | |
while true; do | |
POWER=$($AKASH_PATH/akashctl status | jq -r '.[] | .voting_power' | tail -1 | sed -e 's/^"//' -e 's/"$//') | |
echo 'WE HAVE POWER' $POWER | |
if [ $POWER = 0 ]; then | |
echo 'UNJAILING' | |
echo -e "$WALLET_PASS\n$WALLET_PASS\n" | $AKASH_PATH/akashctl tx slashing unjail --from $WALLET --gas=auto --yes | |
fi | |
echo 'NEXT CHECK IN 15 SEC' | |
sleep 15 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Have a condition to check if the validator is jailed.