-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheckNode.sh
More file actions
executable file
·36 lines (30 loc) · 1 KB
/
checkNode.sh
File metadata and controls
executable file
·36 lines (30 loc) · 1 KB
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
#!/bin/bash
while true
do
State=`docker exec -ti shardeum-dashboard operator-cli status | grep state | awk -F":" '{print $2}'`
State=`echo "${State}" | sed -e "s/^.//;s/.$//"`
case "${State}" in
"standby")
echo "==> "`date` "Node standby"
;;
"stopped")
echo "---------------------------------------"
echo `date` "Node stopped."
echo `date` "Start node."
docker exec -ti shardeum-dashboard operator-cli start
echo "==>" `date` "Node started."
echo "----------------------------------------"
;;
"null")
echo "---------------------------------------"
echo `date` "Node unknown state."
docker exec -ti shardeum-dashboard operator-cli stop
docker exec -ti shardeum-dashboard operator-cli start
echo "==>" `date` "Node restarted."
echo "----------------------------------------"
;;
*) echo "INFO: State not corrected."
echo "${State}";;
esac
sleep 60
done