代码拉取完成,页面将自动刷新
同步操作将从 ZHENFENGSHISAN/spring-boot-projects 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/bash
# author:bezhi
# url:https://github.com/otale/scripts
env_args="-Xms128m -Xmx128m"
sleeptime=0
arglen=$#
# get my-blog pid
get_pid(){
pname="`find .. -name 'my-blog*.jar'`"
pname=${pname:3}
pid=`ps -ef | grep $pname | grep -v grep | awk '{print $2}'`
echo "$pid"
}
startup(){
pid=$(get_pid)
if [ "$pid" != "" ]
then
echo "Blog already startup!"
else
jar_path=`find .. -name 'my-blog*.jar'`
echo "jarfile=$jar_path"
cmd="java $1 -jar $jar_path > ./my-blog.out < /dev/null &"
echo "cmd: $cmd"
java $1 -jar $jar_path > ./my-blog.out < /dev/null &
show_log
fi
}
shut_down(){
pid=$(get_pid)
if [ "$pid" != "" ]
then
kill -9 $pid
echo "Blog is stop!"
else
echo "Blog already stop!"
fi
}
show_log(){
tail -f my-blog.out
}
show_help(){
echo -e "\r\n\t欢迎使用Blog"
echo -e "\r\nUsage: sh my-blog.sh start|stop|reload|status|log"
exit
}
show_status(){
pid=$(get_pid)
if [ "$pid" != "" ]
then
echo "Blog is running with pid: $pid"
else
echo "Blog is stop!"
fi
}
if [ $arglen -eq 0 ]
then
show_help
else
if [ "$2" != "" ]
then
env_args="$2"
fi
case "$1" in
"start")
startup "$env_args"
;;
"stop")
shut_down
;;
"reload")
echo "reload"
;;
"status")
show_status
;;
"log")
show_log
;;
esac
fi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。