For the apple script masters

Discussion in 'Mac Apps and Mac App Store' started by jimsowden, Sep 1, 2004.

  1. jimsowden macrumors 68000

    jimsowden

    Joined:
    Sep 6, 2003
    Location:
    NY
    #1
    I don't use apple script, but i want to get started. I work at an apple dealer, and i want to write a script to shut down all the demo computers. I know how to do this remotley, which is to
    open terminal,
    type in ssh user@ipaddress
    it prompts for password
    enter sudo -s
    it enters password
    enter shutdown -h now.

    I would need this for more than one computer obviously, so if anyone it up to it, a starter script would be much appriciated.
     
  2. iLikeMyiMac macrumors 6502a

    iLikeMyiMac

    Joined:
    Jul 17, 2004
    Location:
    St. Louis
  3. emw macrumors G4

    emw

    Joined:
    Aug 2, 2004
    #3
    Is this something you need to do at random times throughout the day, or do you just want to shut them down at night before you leave?

    If it's the latter, you can use the System Prefs > Energy Saver to tell them to shut down at a certain time every day.
     
  4. jimsowden thread starter macrumors 68000

    jimsowden

    Joined:
    Sep 6, 2003
    Location:
    NY
    #4
    I know about that. I can't get it to do different days and remember. It doesn't work that well.
     
  5. jimsowden thread starter macrumors 68000

    jimsowden

    Joined:
    Sep 6, 2003
    Location:
    NY
  6. jimsowden thread starter macrumors 68000

    jimsowden

    Joined:
    Sep 6, 2003
    Location:
    NY
    #6
    Ok, i got this far:

    tell application "Terminal"
    activate
    do shell script "sudo ssh jimsowden@10.0.1.3" password "xxx" with administrator privileges
    do shell script "shutdown -h now"
    end tell

    That opens it. Now, it should log me in, but it says "Terminal got an error: Pseudo-terminal will not be allocated because stdin is not a terminal.
    Host key verification failed."

    Any ideas?
     
  7. cpjakes macrumors 6502

    Joined:
    Aug 15, 2003
    Location:
    Buffalo, NY
    #7
    If you work at an Apple dealer, why not just use Remote Desktop, manage your demo computers as a group, and just shut them all down at once?

    cpjakes
     
  8. jimsowden thread starter macrumors 68000

    jimsowden

    Joined:
    Sep 6, 2003
    Location:
    NY
    #8
    Net admin won't let me. I wanted to have netboot, but that was out of the question. This is all i got. I got to typing

    tell application "terminal" to do shell script "ssh jimsowden@10.0.1.3" password "xxx" with administrator privileges

    but this returns a psuedo terminal error. I have no idea why.
     
  9. superbovine macrumors 68030

    superbovine

    Joined:
    Nov 7, 2003

Share This Page