Hello, i wrote a python script to check wether servers on my remote VPS machine are online.
When they are not online, it means the process could have died, or that the process is stalled ( not responding). When it's not responding, it won't respond to packet i send with python.
When server is not responsive, i run a .sh script with os.system('script.sh process_name path_to_process').
my script.sh looks like this:
$pid = `pidof -s $1`
if [ $pid -eq ""]
echo "$1 not found!"
basically what i want to do is:
check if the process is alive: if so, kill it.
start server, and detach it from screen and return to python window.
This script gives me all kind of problems:
./home/script.sh: line4 =:command not found
There is no screen to be detached.
I'm doing this all using putty on a remote VPS. I have absolutely no idea what i'm doing in the shell script, i just all googled this together. I don't feel like learning ANOTHER scripting language, so that's why i came here to ask.