Trying to remote shutdown Ubuntu computer on same lan using a Mac computer. If I open Terminal on mac, I CAN shut down the Ubuntu by using: ssh testbox@12.34.56.78, then typing in the password, then typing sudo poweroff, typing in password again. This DOES work.
The problem is I need to do this by using Mac Applescript. (so I can create a Calendar Event and have it run at a certain time of day after backups are done)
NOTE: I have successfully created an Applescript that Wakeonlan turns ON the Ubuntu at a specific time of the day:
tell application "Terminal"
set currentTab to do script
("ssh testbox@192.168.1.12;")
delay 6
--//password
do script ("~/bin/wakeonlan 00:11.22.33.44.55")
end tell
This works well, sends the wakeonlan and starts Ubuntu, but I can't figure out how to do the same thing to SHUTDOWN Ubuntu computer? I've tried just about everything? All the posts I find only show how to do this from Ubuntu Terminal, NOT from Mac AppleScript put in Mac's Terminal?
192.168.1.12
the Ubuntu machine? If so, your WOL script does not do what you may think it does. If not, why do you need to send the WOL packet from a different machine? – danzel Sep 10 '20 at 14:37