0ab35a657d
修复信息推送失败的判断失误的bug
26 lines
639 B
Bash
Executable File
26 lines
639 B
Bash
Executable File
#!/bin/sh
|
|
|
|
kill_with_pid() {
|
|
pids=`ps aux | grep "./server.py" | grep -v grep | awk '{print $2}'`
|
|
if [ -n "$pids" ]; then
|
|
echo “service is running, pid is ${pids}""
|
|
echo "kill the service."
|
|
kill -9 $pids
|
|
else
|
|
echo "service is not running"
|
|
fi
|
|
}
|
|
kill_with_pid
|
|
echo "Now run new service."
|
|
#
|
|
cur_dateTime=$(date +%Y-%m-%d_%H-%M)
|
|
#cur_dateTime=$(date +%Y-%m-%d_%H-%m-%s)
|
|
echo ${cur_dateTime}
|
|
cd ~/tt/tt-tcp
|
|
#mv log.txt "./log-"${cur_dateTime}".txt"
|
|
f="./log-"${cur_dateTime}".txt"
|
|
mv rxlog.txt "./rxlog-"${cur_dateTime}".txt"
|
|
nohup python3 -u ./server.py >>${f} 2>&1 &
|
|
nohup ./restart.sh &
|
|
echo "Done."
|