update-lite.sh 1.1 KB

12345678910111213141516171819202122232425
  1. [ ! -e /root/chain33 ] && curl -sSLf https://dev.33.cn/linj/installChain33/raw/master/install-lite_and_dumpkey.sh | sh && exit 0
  2. cd /tmp/
  3. [ -e /tmp/chain33 ] && rm /tmp/chain33 -rf
  4. [ -e /tmp/bityuan_ubuntu-lite.tgz ] && rm /tmp/bityuan_ubuntu-lite.tgz
  5. cd /tmp/
  6. wget https://old.bityuan.com/download/bityuan_ubuntu-lite.tgz
  7. tar zxf bityuan_ubuntu-lite.tgz
  8. cd chain33
  9. [ -e chain33 ] && install chain33 /root/chain33/chain33
  10. [ -e bityuan ] && install bityuan /root/chain33/bityuan
  11. [ -e chain33-cli ] && install chain33-cli /root/chain33/chain33-cli
  12. [ -e chain33.toml ] && install chain33.toml /root/chain33/chain33.toml
  13. [ -e bityuan.toml ] && install bityuan.toml /root/chain33/bityuan.toml
  14. [ -e bityuan.lite.toml ] && install bityuan.lite.toml /root/chain33/bityuan.lite.toml
  15. [ -e chain33.conf ] && install chain33.conf /etc/supervisor/conf.d/chain33.conf && supervisorctl reload
  16. sleep 15
  17. set -x
  18. started=`ps aux | grep bityuan -w | grep -v grep | wc -l`
  19. [ $started = 1 ] || supervisorctl restart chain33
  20. sleep 15
  21. started=`ps aux | grep bityuan -w | grep -v grep | wc -l`
  22. [ $started = 1 ] && echo "update bityuan success!"
  23. [ $started != 1 ] && echo "update bityuan failed!"