I'm trying to get my Proxmox host to reboot when it fails to ping out of the network. I wrote a script that works outside of a cronjob, but when i try to have it automate it using crontab it doesn't even register in the logs what there was an error
Currently my cron job looks like this.
*/5 * * * * cd /root/My_Scripts && ./reboot
I checked the permissions for the script and everyone has executable permissions.
This is the current state of the reboot script
ping -c1 1.1.1.1
if [ $? -eq 0 ]
then
echo "Good Ping"
else shutdown -r
fi
Do y'all have any idea on how to fix this?
Currently my cron job looks like this.
*/5 * * * * cd /root/My_Scripts && ./reboot
I checked the permissions for the script and everyone has executable permissions.
This is the current state of the reboot script
ping -c1 1.1.1.1
if [ $? -eq 0 ]
then
echo "Good Ping"
else shutdown -r
fi
Do y'all have any idea on how to fix this?