I know this topic has been covered a few times before but I need to schedule a reboot to install updates once a month on a specific day and time and I was told the only way to do this was via a plist and script. I have written a plist via Lingon that I have in my Launch Agents that runs once a month on the 30th of every month at a specific time that references a reboot script that I have in the Users/Shared folder called forcereboot.sh. When I run the reboot script from Users/Shared on its own it runs fine. Right now the plist runs as it should, and reschedules itself for the next month, but doesn't seem to run the script. This is the plist located in Launch Agents. I have also tried running this as root in the Launch Deamons and issue persists. (This has a different time listed for testing purposes)
<?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>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin</string>
</dict>
<key>Label</key>
<string>com.local.forcereboot</string>
<key>ProgramArguments</key>
<array>
<string>/Users/Shared/forcereboot.sh</string>
</array>
<key>RunAtLoad</key>
<false/>
<key>StartCalendarInterval</key>
<array>
<dict>
<key>Day</key>
<integer>9</integer>
<key>Hour</key>
<integer>9</integer>
<key>Minute</key>
<integer>30</integer>
</dict>
</array>
<key>WorkingDirectory</key>
<string>/Users/Shared/forcereboot.sh</string>
</dict>
</plist>
This is the script located in Users/Shared
!/bin/sh
/usr/local/jamf/bin/jamf displayMessage -message "Your Mac will reboot in 90 seconds to install necessary system updates."
sleep 90
softwareupdate --install --all
shutdown -r now
The plist runs fine, as its displayed in console and reschedules itself for next month, but nothing happens. The script doesn't run. No message comes up. The system doesn't reboot. Any idea what's going on?
