This discussion is locked
mister woofie

Q: running shell script at startup (before login)

Objective: on the Mac side of a dual-boot Intel, I want to automate running a shell script at startup that will unmount the "Untitled" Windows partition. As a single line command, the following runs correctly when invoked manually from Terminal:

/usr/sbin/diskutil unmount force disk0s3

How can I include this script in the startup sequence?

iMac Intel Core 2 Duo, white, 1.83 GHz, Mac OS X (10.5.3)

Posted on Jun 25, 2008 7:44 AM

Close

Q: running shell script at startup (before login)

  • All replies
  • Helpful answers

Previous Page 2
  • by macwiz1220,

    macwiz1220 macwiz1220 Jun 25, 2008 11:36 AM in response to V.K.
    Level 4 (1,940 points)
    Jun 25, 2008 11:36 AM in response to V.K.
    Well that is different. We have two different AppleScripts.

    I was using
    do script

    You were using
    do shell script

    They both work depending on what you need.
  • by Barney-15E,

    Barney-15E Barney-15E Jun 25, 2008 2:12 PM in response to mister woofie
    Level 9 (50,871 points)
    Mac OS X
    Jun 25, 2008 2:12 PM in response to mister woofie
    What is complex about my solution? It is the way it is supposed to be done. Lingon is a GUI to add an entry in the the Launchctl system.
    1) download Lingon
    2) Create new user daemon
    3) enter path to your script
    4) select options on when it should run and should it be kept running
    Depending on your connection, 5 minutes.
  • by mister woofie,

    mister woofie mister woofie Jun 25, 2008 5:53 PM in response to Barney-15E
    Level 1 (0 points)
    Jun 25, 2008 5:53 PM in response to Barney-15E
    Thank you. Lingon is in fact simple to use and the right tool for the job. It was before looking at it that I assumed I would have to learn more about daemons than I wanted to. Using a lingon produced daemon, unmounting the partition is invisible to the user, unlike an Automator produced app that's launched at login and shows up momentarily in the dock... The image I'm developing is for a lab, and I'd like the user experience to be as simple as possible. This meets the need.

    Thank you all for your help.
Previous Page 2