- Code: Select all
import os
myPassword = "put my password here"
# for reboot:
cmd = "/sbin/reboot"
# for shutdown
#cmd = "/sbin/shutdown now"
os.system("echo '"+ myPassword + "' | sudo -S "+cmd+" &")
when executed the mac indigo server will reboot or will shut down depending on the option chosen.
Karl