Scripts help, have a sh file run automatically

Hi forum,
I have a script saved to directory /root/netgear-m1 download from

I can run the script manually from ssh terminal, but I need it to run automatically with this script command, on the event of the 4G router dropping the connection.

echo $PASSWORD | ./netgear-m1.sh reboot

I have watchcat installed that can run a script, but how can I point it to the above directory & command.

thanks in advance

he first piece of advice, hoping it's not out of place, is to enter the password inside the script so you don't have to pass parameters to the script.

can you post the current configuration of your Watchcat

I'll give it ago
so if I add the password to the script, I can use to watchcat

Script to run

 /root/netgear-m1/netgear-m1.sh reboot

is that correct

the second tip if you really have to pass these parameters to the script why don't you create another one called:

echo " echo \"mypassword\" | /root/netgear-m1.sh reboot" > /root/test

with the commands you want inside and run /root/test

or (if the password into script)

echo "/root/netgear-m1.sh reboot" > /root/test
chmod 700 /root/test