-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathunjail.sh
39 lines (29 loc) · 905 Bytes
/
unjail.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# set -x
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m' # No Color
DELAY=900 #in secs - how often restart the script
for (( ;; )); do
# проверяем где валик
stchaincli query staking validator $(stchaincli keys show $NICKNAME \
--bech val --address --keyring-backend test) \
--trust-node \
--node `cat "$HOME/.stchaind/config/config.toml" \
| grep -oPm1 "(?<=^laddr = \")([^%]+)(?=\")"` | grep jailed > 1
if grep -q true 1; then stchaincli tx slashing unjail \
--from=$NICKNAME \
--chain-id=stratos-testnet-3 \
--keyring-backend=test \
--gas="auto" \
--gas-prices="0.5ustos" \
--gas-adjustment=1.5 \
--node `cat "$HOME/.stchaind/config/config.toml" \
| grep -oPm1 "(?<=^laddr = \")([^%]+)(?=\")"` -y
fi
for (( timer=${DELAY}; timer>0; timer-- ))
do
printf "* sleep for ${RED}%02d${NC} sec\r" $timer
sleep 1
done
done