<<Script>>
#!/bin/bash
VARIABLE=$(/usr/bin/osascript
<<-EOF
tell application
"System Events"
activate
set question to display dialog "The machine
has not been shut down or restarted for more than a week. Please shut down or
restart the machine by clicking on Shut Down or Restart." with title
"System Event by Andres Cheah, MCM" buttons {"Shut Down",
"Restart", "Cancel"} with icon caution
set answer to button returned of question
if answer is equal to "Shut Down" then
tell application "System Events"
shut down
end tell
end if
if answer is equal to "Restart" then
tell application "System Events"
restart
end tell
end if
if answer is equal to "Cancel" then
return
end if
end tell
EOF)
No comments:
Post a Comment