echo $(date) " - Running poweroffhe.sh as user $(whoami)" >> $POWERLOG
echo $(date) " - Hubitat Elevation shutdown..." >> $POWERLOG*
curl -k -c $FILECOOKIE -d username=$USER -d password=$PASS https://$HOST/login
if [ $? = 1 ]; then
echo $(date) " - Hubitat curl login failed" >> $POWERLOG
exit 1
fi
curl -k -sb -X POST https://$HOST/hub/shutdown
sudo -u control $CHECKOFF &
rm $FILECOOKIE
exit 0
I've checked the login curl which is working, or I'm not seeing any errors. The script appears to complete without errors. Any ideas as to why the hub is not shutting down?
Can't claim to to ffer a solution to your issue with the script... but would recommend looking at the Hub Info driver we which allows shutdown and reboot. Just something else that may help....