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

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -