代码拉取完成,页面将自动刷新
同步操作将从 zhoudaqing/ngr 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#version_1.0
#!/bin/bash
source /etc/profile
ENV="xxx"
function help() {
echo "Usage: $0 start|reload|stop|restart"
}
#function port_check(){
# status=`curl -o /dev/null -I -s -w '%{http_code}' http://localhost:80`
# if [[ $status == 200 || $status == 302 ]];then
# echo "port:80 ok"
# echo "SUCCESS"
# exit 0
# else
# echo "port:80 check error"
# exit 1
# fi
#}
function start(){
ngrAdmin start
if [ $? != 0 ];then
echo "ngrAdmin start error"
else
echo "ngrAdmin started"
echo "SUCCESS"
exit 0
fi
}
function restart(){
ngrAdmin restart
if [ $? != 0 ];then
echo "ngrAdmin restart error"
else
echo "ngrAdmin restarted"
echo "SUCCESS"
exit 0
fi
}
function reload(){
make install-config profile=$ENV
if [ $? != 0 ];then
echo "ngrAdmin install error"
else
echo "ngrAdmin installed"
ngrAdmin reload
if [ $? != 0 ];then
echo "ngrAdmin reload error"
else
echo "ngrAdmin reloaded"
echo "SUCCESS"
exit 0
fi
fi
}
function stop(){
ngrAdmin stop
if [ $? != 0 ];then
echo "ngrAdmin stop error"
else
echo "ngrAdmin stoped"
echo "SUCCESS"
exit 0
fi
}
#输入提示
if [ "$1" == "" ]; then
help
elif [ "$1" == "stop" ]; then
stop
elif [ "$1" == "start" ]; then
start
elif [ "$1" == "restart" ]; then
restart
elif [ "$1" == "reload" ]; then
reload
else
help
fi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。