同步操作将从 devops运维开发/gopub 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/bash -eexport GOROOT=/usr/local/goexport PATH=$PATH:/usr/local/go/bin/DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"BASENAME=`basename $DIR`export GOPATH=$DIRexport GOBIN=$DIR/bin/app=$BASENAMEconf=$DIR/src/conf/app.confpidfile=$DIR/$BASENAME.pidlogfile=$DIR/$BASENAME.logfunction check_pid() {if [ -f $pidfile ];thenpid=`cat $pidfile`if [ -n $pid ]; thenrunning=`ps -p $pid|grep -v "PID TTY" |wc -l`return $runningfifireturn 0}function build() {gofmt -w $DIR/src/cd $DIR/src/go build -o $BASENAMEif [ $? -ne 0 ]; thenexit $?fi}function pack() {buildcd ..rm -rf $BASENAME/src/logs/*cd .. && tar zcvf $app.tar.gz $BASENAME/control $BASENAME/src/$app $BASENAME/src/conf $BASENAME/src/logs $BASENAME/src/agent $BASENAME/src/views $BASENAME/src/static $BASENAME/src/favicon.ico}function start() {check_pidrunning=$?if [ $running -gt 0 ];thenecho -n "$app now is running already, pid="cat $pidfilereturn 1fiif ! [ -f $conf ];thenecho "Config file $conf doesn't exist, creating one."ficd $DIR/src/nohup ./$BASENAME >$logfile 2>&1 &sleep 1running=`ps -p $! | grep -v "PID TTY" | wc -l`if [ $running -gt 0 ];thenecho $! > $pidfileecho "$app started..., pid=$!"elseecho "$app failed to start."return 1fi}function killall() {pid=`cat $pidfile`ps -ef|grep $BASENAME|grep -v grep|awk '{print 2ドル}'|xargs kill -9rm -f $pidfileecho "$app killed..., pid=$pid"}function stop() {#ps -ef|grep $BASENAME|grep -v grep|awk '{print 2ドル}'|xargs kill -9pid=`cat $pidfile`kill $pidrm -f $pidfileecho "$app stoped..., pid=$pid"}function restart() {stopsleep 1start}function reload() {pid=`cat $pidfile`kill -HUP $pidsleep 1newpid=`ps -ef|grep $BASENAME|grep -v grep|awk '{print 2ドル}'`echo "$app reload..., pid=$newpid"echo $newpid > $pidfile}function status() {check_pidrunning=$?if [ $running -gt 0 ];thenecho startedelseecho stopedfi}function run() {cd $DIR/src/./$BASENAME -docker#go run main.go}function rundocker() {cd $DIR/src/./$BASENAME -docker#go run main.go}function init() {cd $DIR/src/./$BASENAME -syncdb#go run main.go}function beerun() {cd $DIR/src/bee run}function tailf() {tail -f $logfile}function docs() {cd $DIR/src/bee generate docs}function sslkey() {cd $DIR/src/conf/ssl###CA:#私钥文件openssl genrsa -out ca.key 2048}function help() {echo "0ドル build|start|stop|kill|restart|reload|run|rundocker|init|tail|docs|pack|beerun|sslkey"}if [ "1ドル" == "" ]; thenhelpelif [ "1ドル" == "build" ];thenbuildelif [ "1ドル" == "pack" ];thenpackelif [ "1ドル" == "start" ];thenstartelif [ "1ドル" == "stop" ];thenstopelif [ "1ドル" == "kill" ];thenkillallelif [ "1ドル" == "restart" ];thenrestartelif [ "1ドル" == "reload" ];thenreloadelif [ "1ドル" == "status" ];thenstatuselif [ "1ドル" == "run" ];thenrunelif [ "1ドル" == "rundocker" ];thenrundockerelif [ "1ドル" == "init" ];theninitelif [ "1ドル" == "beerun" ];thenbeerunelif [ "1ドル" == "tail" ];thentailfelif [ "1ドル" == "docs" ];thendocselif [ "1ドル" == "sslkey" ];thensslkeyelsehelpfi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。