代码拉取完成,页面将自动刷新
#!/usr/bin/env bash
PIDFILE=~/zkui.pid
ZKUIBINDIR=$(cd `dirname $0`; pwd)
ZKUICLASSNAME="target/zkui-2.0-SNAPSHOT-jar-with-dependencies.jar"
ZKUI_DAEMON_OUT=$ZKUIBINDIR/zkui.out
start(){
echo "Starting zkui ... $ZKUIBINDIR"
if [ -f "$PIDFILE" ]; then
if kill -0 `cat "$PIDFILE"` > /dev/null 2>&1; then
echo zkui already running as process `cat "$PIDFILE"`.
exit 0
fi
fi
cp config.cfg target
nohup java -jar "$ZKUIBINDIR/$ZKUICLASSNAME" > "$ZKUI_DAEMON_OUT" 2>&1 < /dev/null &
if [ $? -eq 0 ];
then
echo $!>$PIDFILE
if [ $? -eq 0 ];
then
sleep 1
echo STARTED
else
echo FAILED TO WRITE PID
exit 1
fi
else
echo SERVER DID NOT START
exit 1
fi
}
stop(){
echo -n "Stopping zkui ... "
if [ ! -f "$PIDFILE" ]
then
echo "no zkui to stop (could not find file $PIDFILE)"
else
kill -9 $(cat "$PIDFILE")
rm "$PIDFILE"
echo STOPPED
fi
exit 0
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
shift
"$0" stop
sleep 3
"$0" start
;;
*)
echo "Usage: $0 {start|stop|restart}" >&2
esac
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。