Advertisement
Guest User

Untitled

a guest
May 1st, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.25 KB | None | 0 0
  1. cd /opt/lisk/client
  2. tail -Fn0 logs.log |
  3. while read line ; do
  4.  
  5. #       echo "$line" | grep "Fork"
  6. #       if [ $? = 0 ]; then
  7. #               echo "Fork found: $line" | mail -s "Alarm!: Fork found" metal494@gmail.com
  8. #       fi
  9.  
  10.         echo "$line" | grep "ETIMEDOUT"
  11.         if [ $? = 0 ]; then
  12.                 echo "LiskNode: Timeout found $line, rebuilding..." | mail -s "Alarm! on LiskNode: Connection Timeout Found" metal494@gmail.com
  13. #               bash lisk.sh rebuild
  14.         fi
  15.  
  16.         echo "$line" | grep "EADDRINUSE"
  17.         if [ $? = 0 ]; then
  18.                 echo "LiskNode: Address in use found $line, rebuilding..." | mail -s "Alarm!  on LiskNode: Address in use Found" metal494@gmail.com
  19.                 bash lisk.sh stop
  20.                 kill -9 $(ps xa | grep '[l]isk.sh' | awk '{print $1}')
  21.                 killall -9 node
  22.                 bash lisk.sh start
  23.         fi
  24.  
  25.         echo "$line" | grep "\"cause\":3"
  26.         if [ $? = 0 ]; then
  27.                 echo "LiskNode: Fork with root cause code 3 found $line, rebuilding" | mail -s "Alarm! on LiskNode: Fork with root cause code 3 Fo$
  28.                echo "Auto Rebuilding lisk..."
  29.                bash lisk.sh rebuild
  30.                echo "Auto Rebuilding Done"
  31.        fi
  32. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement