Browse Source

修复多次升级的问题

linj-disanbo 4 years ago
parent
commit
5394aacf39
1 changed files with 5 additions and 3 deletions
  1. 5 3
      update.sh

+ 5 - 3
update.sh

@@ -1,10 +1,12 @@
-[ -e /root/bityuan ] && echo "bityuan exist. please rename or backup bityuan first. package will install to bityuan" && exit 0
-[ ! -e /root/chain33 ] && curl -sSLf https://dev.33.cn/linj/installChain33/raw/master/install_and_dumpkey.sh | sh && exit 0
-supervisorctl stop chain33
+[ -e /root/bityuan ] && [ -e /root/chain33 ] && echo "bityuan exist. please rename or backup bityuan first. package will install to bityuan" && exit 0
+[ ! -e /root/chain33 ] && [ ! -e /root/bityuan ] && curl -sSLf https://dev.33.cn/linj/installChain33/raw/master/install_and_dumpkey.sh | sh && exit 0
+[ -e /etc/supervisor/conf.d/chain33.conf ] && supervisorctl stop chain33
+[ -e /etc/supervisor/conf.d/bty.conf ] && supervisorctl stop bty
 
 
 [ -e /etc/supervisor/conf.d/chain33.conf ] && rm /etc/supervisor/conf.d/chain33.conf
 [ -e /etc/supervisor/conf.d/chain33.conf ] && rm /etc/supervisor/conf.d/chain33.conf
 [ -e /root/chain33 ] && mv /root/chain33 /root/bityuan
 [ -e /root/chain33 ] && mv /root/chain33 /root/bityuan
 
 
+
 cd /tmp/
 cd /tmp/
 [ -e /tmp/chain33 ] && rm /tmp/chain33 -rf
 [ -e /tmp/chain33 ] && rm /tmp/chain33 -rf
 [ -e /tmp/bityuan ] && rm /tmp/bityuan -rf
 [ -e /tmp/bityuan ] && rm /tmp/bityuan -rf