tt-server/run_tt_server.sh

27 lines
675 B
Bash
Raw Normal View History

2023-04-19 11:55:42 +00:00
#!/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."
#
2024-01-25 02:25:08 +00:00
# cur_dateTime=$(date +%Y-%m-%d_%H-%M)
2023-04-19 11:55:42 +00:00
#cur_dateTime=$(date +%Y-%m-%d_%H-%m-%s)
2024-01-25 02:25:08 +00:00
# echo ${cur_dateTime}
2024-01-07 02:48:47 +00:00
# cd ~/tt-tcp
2023-04-19 11:55:42 +00:00
#mv log.txt "./log-"${cur_dateTime}".txt"
2024-01-07 02:48:47 +00:00
# f="./log-"${cur_dateTime}".txt"
2024-01-25 02:25:08 +00:00
# mv rxlog.txt "rxlog/rxlog-"${cur_dateTime}".txt"
2024-01-07 02:48:47 +00:00
nohup python3 -u ./server.py &
#nohup ./restart.sh &
nohup ./restart.sh >> reboot.log &
2023-04-19 11:55:42 +00:00
echo "Done."