linux - kill a process in bash script -
I would like to kill and restart a process and this command works on interactive mode but not in script mode.
Any suggestions:
"kill current server" "$ kill (ps -a | grep 'myserver.jar' | awk '{print $ 2}' ) Resonates || || echo 'active myser', exit; 1;
This can work:
v = $ (Pgrep -f myserver.jar) if [$? == 0]; then $ v else to "no server" fi # start server Kill ...
Comments
Post a Comment