#!/bin/bash #默认$GOROOT 已经存在,并为/usr/local/go/ app=***job serviePath=`pwd` export GOPATH=$(dirname $serviePath) cd $app p=$(pidof $serviePath/$app/$app ) if [ $p ] then echo "kill $app pid $p" kill -9 $p fi echo "$app building..." go build -o $app echo "$app start..." nohup $serviePath/$app/$app & echo "new $app pid $(pidof $serviePath/$app/$app )" echo "end...." exit
有疑问加站长微信联系(非本文作者)