mirror of
https://gitee.com/willbeahero/IOTGate.git
synced 2024-11-29 18:38:08 +08:00
脚本完善
This commit is contained in:
parent
5c1c03c84d
commit
00e4820bd0
@ -1,5 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#守护进程脚本,当网关异常关闭时主动重启网关
|
#守护进程脚本,当网关异常关闭时主动重启网关
|
||||||
|
#建议直接通过该脚本启动网关!
|
||||||
#author:杨承
|
#author:杨承
|
||||||
#网关编号
|
#网关编号
|
||||||
NUM=1
|
NUM=1
|
||||||
@ -28,17 +29,17 @@ function start {
|
|||||||
command=`nohup java $JVM -jar $BASE_DIR/IOTGate.jar -n $NUM -f $BASE_DIR/iotGate.conf -m $MASTERIP > $BASE_DIR/$LOGNAME.log &`
|
command=`nohup java $JVM -jar $BASE_DIR/IOTGate.jar -n $NUM -f $BASE_DIR/iotGate.conf -m $MASTERIP > $BASE_DIR/$LOGNAME.log &`
|
||||||
`info $command`
|
`info $command`
|
||||||
fi
|
fi
|
||||||
tail -10f $BASE_DIR/$LOGNAME.log
|
tail -n 30 $BASE_DIR/$LOGNAME.log
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for((i=0 ; ; i++))
|
for((i=0 ; ; i++))
|
||||||
do
|
do
|
||||||
|
sleep 1
|
||||||
server=`ps aux | grep IOTGate.jar | grep -v grep`
|
server=`ps aux | grep IOTGate.jar | grep -v grep`
|
||||||
if [ ! "$server" ]; then
|
if [ ! "$server" ]; then
|
||||||
#如果不存在就启动
|
#如果不存在就启动
|
||||||
start
|
start
|
||||||
sleep 1
|
|
||||||
fi
|
fi
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user