+ Post New Thread
Results 1 to 6 of 6
Mac Thread, Run Shell Script BEFORE logon in Technical; Hi all, Anyone know how to run a shell script BEFORE a user logs on? Cheers, Martin...
  1. #1

    Join Date
    Jul 2008
    Location
    Merseyside
    Posts
    295
    Thank Post
    16
    Thanked 10 Times in 10 Posts
    Rep Power
    14

    Run Shell Script BEFORE logon

    Hi all,

    Anyone know how to run a shell script BEFORE a user logs on?

    Cheers,
    Martin

  2. #2
    dayzd's Avatar
    Join Date
    Nov 2009
    Location
    In front of computer
    Posts
    403
    Thank Post
    74
    Thanked 59 Times in 48 Posts
    Rep Power
    24
    A LoginHook will do that (You'll want to use the 'Mac OS X 10.3, 10.4, or later' method. Trust me, it's easier!).
    It will run the script you specify as the very first action as a user logs in, allowing you to set up the computer before anything user-related is configured.
    Apparently you can set login scripts using Workgroup Manager, but I've had no success with it, and I believe it is very hard to get it working.

    Bombich.com also has some content on LoginHooks I found useful.

  3. #3

    Join Date
    Jul 2008
    Location
    Merseyside
    Posts
    295
    Thank Post
    16
    Thanked 10 Times in 10 Posts
    Rep Power
    14
    Yeah I've seen this but a loginhook runs AT login, not BEFORE login which is what I need. I need a script that will unbind the machine from AD and then rebind to AD as the computer starts (pref before it shows the login prompt).

    Any other ideas?
    Thanks

  4. #4
    dayzd's Avatar
    Join Date
    Nov 2009
    Location
    In front of computer
    Posts
    403
    Thank Post
    74
    Thanked 59 Times in 48 Posts
    Rep Power
    24
    Uhrm... You might get a LaunchAgent to do that, but I've never used one.

    Some Launchd Recipes | mac geekery might get you started.

  5. #5

    Join Date
    Jan 2010
    Location
    Northampton
    Posts
    13
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    You need to use a StartupItem. These will run the script on system startup.

    You need to place the executable shell script in a folder placed in /Library/StartupItems. The filename of the script MUST be the same as the folder. You then need to include a plist, name StartupParameters.plist.

    Not exactly sure on the contents of the plist, there startup item I use was written by somebody else. But this thread will explain the startup item I use and the process of creating it...

    Snow Leopard AD Integration woes

    Check out the first post by Ephelyon.

    There are a few resources on startupitems on google as well

  6. #6

    Join Date
    Apr 2014
    Location
    Miami
    Posts
    1
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    This seems to run after the user logs in, we are still having the 'woe'.

    Any newer solutions?

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 16
    Last Post: 25th February 2010, 08:59 AM
  2. Replies: 1
    Last Post: 9th September 2009, 07:22 PM
  3. Logon script & Printer script question.
    By Galway in forum Windows
    Replies: 3
    Last Post: 29th August 2007, 11:00 AM
  4. WScript.Shell Run
    By PiqueABoo in forum Scripts
    Replies: 2
    Last Post: 23rd May 2007, 07:45 AM
  5. Stop users closing bat/cmd shell at logon
    By apeo in forum How do you do....it?
    Replies: 10
    Last Post: 8th May 2007, 12:37 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •