| 123456789101112131415161718192021222324252627282930313233343536 |
- # note : 在程序运行目录执行此脚本, 升级go服务到最新构建的版本。升级完成自动重启go服务
- # --------------------------------------------------------------------
- function excute() {
- local arg=$1
- if [[ "$arg" == mtp20_access_*.zip ]]; then
- filename=$1
- updateSpecialVer $filename
- else
- # 获取最新版本的文件名
- rm -f console
- wget -c http://192.168.30.153:8080/view/mtp2.0_release/job/mtp2.0_go_access_GZ_linux/label=192.168.31.56/lastBuild/console
- filename=`grep -o -w -m1 mtp2.*zip console`
- updateSpecialVer $filename
- fi
- }
- # 更新版本
- function updateSpecialVer() {
- local filename=$1
- mkdir -p upmtpgo
- cd upmtpgo
- wget -c http://192.168.30.153/share/build/mtp2.0_release/$filename
- rm -rf mtp2_access_go
- unzip $filename -d mtp2_access_go
- cp ../config.yaml ./mtp2_access_go/config.yaml
- cp -rf ./mtp2_access_go/* ../
- cd ..
- rm -rf upmtpgo
- pkill access_go
- nohup `pwd`/access_go &
- rm -f ./update.sh
- rm -f console
- }
- excute $1
|