Hey,
I found this script and made changes to reflect what I needed but it seems the StartCalendarInterval is not working. It triggers the first time but then it does not run again at the time its schedule even if the computer is awake. Iv tested by keeping it awake and changing the time on the mac.
#!/bin/bash
echo "<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.Org.shutdown</string>
<key>UserName</key>
<string>root</string>
<key>Program</key>
<string>/sbin/shutdown</string>
<key>ProgramArguments</key>
<array>
<string>/sbin/shutdown</string>
<string>-r</string>
<string>now</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Weekday</key>
<integer>5</integer>
<key>Hour</key>
<integer>3</integer>
<key>Minute</key>
<integer>00</integer>
</dict>
</dict>
</plist>" > /Library/LaunchDaemons/com.Org.shutdown.plist
chown root "/Library/LaunchDaemons/com.Org.shutdown.plist"
chmod 644 "/Library/LaunchDaemons/com.Org.shutdown.plist"
launchctl load -w "/Library/LaunchDaemons/com.Org.shutdown.plist"
