I have a node app running on my Linux hosting server.
Sometimes the app crashes and I need to restart it, so I log in and type these commands:
pkill node cd public_html/n49900_dpndev node server.js &
And the app runs again.
Now I would like to put this into a script so I simply need to start the script (or can execute it from a PHP script, for instance).
I created a file called "startnode":
#!/bin/bash pkill node cd public_html/n49900_dpndev node server.js &
I changed the permissions with
chmod 755 startnode.
But when I execute it with
./startnode it responds with:
What do I need to do so that the commands I type in manually also work in the bash script?