1
0

newupdate.sh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. [ -e /33cn/bityuan ] && [ -e /33cn/chain33 ] && echo "bityuan exist. please rename or backup bityuan first. package will install to bityuan" && exit 0
  2. [ ! -e /33cn/chain33 ] && [ ! -e /33cn/bityuan ] && curl -sSLf https://dev.33.cn/xs/installChain33/raw/master/newin_dump.sh | sh && exit 0
  3. [ -e /etc/supervisor/conf.d/chain33.conf ] && supervisorctl stop chain33
  4. [ -e /etc/supervisor/conf.d/bty.conf ] && supervisorctl stop bty
  5. [ -e /etc/supervisor/conf.d/chain33.conf ] && rm /etc/supervisor/conf.d/chain33.conf
  6. [ -e /33cn/chain33 ] && mv /33cn/chain33 /root/bityuan
  7. cd /tmp/
  8. [ -e /tmp/chain33 ] && rm /tmp/chain33 -rf
  9. [ -e /tmp/bityuan ] && rm /tmp/bityuan -rf
  10. [ -e /tmp/bityuan_ubuntu.tgz ] && rm /tmp/bityuan_ubuntu.tgz
  11. cd /tmp/
  12. wget https://old.bityuan.com/download/bityuan_ubuntu.tgz
  13. tar zxf bityuan_ubuntu.tgz
  14. cd bityuan
  15. cd /33n/bityuan
  16. rm -rf bty.conf bty
  17. wget https://dev.33.cn/xs/installChain33/raw/master/bty
  18. wget https://dev.33.cn/xs/installChain33/raw/master/bty.conf
  19. [ -e bityuan ] && install bityuan /33cn/bityuan/bityuan
  20. [ -e bityuan-cli ] && install bityuan-cli /33cn/bityuan/bityuan-cli
  21. [ -e bityuan.toml ] && install bityuan.toml /33cn/bityuan/bityuan.toml
  22. [ -e bty ] && install bty /33cn/bityuan/bty
  23. [ -e bty.conf ] && install bty.conf /etc/supervisor/conf.d/bty.conf
  24. supervisorctl reload
  25. sleep 15
  26. set -x
  27. started=`ps aux | grep bityuan -w | grep -v grep | wc -l`
  28. [ $started = 1 ] || supervisorctl restart bty
  29. sleep 15
  30. started=`ps aux | grep bityuan -w | grep bityuan.toml | grep -v grep | wc -l`
  31. [ $started = 1 ] && echo "update bityuan success!"
  32. [ $started != 1 ] && echo "update bityuan failed!"