static

start.sh 472B

    #!/bin/sh #@auth:yangbiao@asiainfo.com #@time:2015-01-12 14:21 #@desc:gogs启动脚本 #记录当前目录并定位当前目录 old_dir=${PWD} cd `dirname $0` #读取配置,不需要可执行权限 . ./gogs.cfg cd ${GOGS_PATH} #清空日志 echo "" > ./gogs_nohup.out #启动gogs nohup ./gogs web > ./gogs_nohup.out 2>&1 & [ $? == 0 ]&&{ echo "[Gogs启动成功]" } sleep 1 tail -n 100 -f gogs_nohup.out #返回脚本执行目录 cd ${old_dir}