And this doesn't work either I think.
/sbin/shutdown h +m 2
It should be "/sbin/shutdown
-h $TIMESPEC"
And why waste a sleep? Just set the shutdown for now + 3 hours.
Add to /etc/rc.d/rc.local or equivalent, use "shutdown -c" to stop it:
Code:
TIMESPEC=`date --date='now + 3 hours' +"%H:%M"`
/sbin/shutdown -h $TIMESPEC &