• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Option to execute a command?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Option to execute a command?


  • Subject: Re: Option to execute a command?
  • From: Per Olofsson <email@hidden>
  • Date: Thu, 31 Mar 2011 06:55:08 +0000
  • Thread-topic: Option to execute a command?

30 mar 2011 kl. 21:11 skrev Karl Kuehn:

> One thing that is missing in this conversation is that you could be running this installer targeted at a volume other than the boot volume. It is really simple to catch this case, so we should always be pushing people to do this when they write installer scripts.

Good catch, and you're probably right about -w too. My reasoning was that if an upgrade fails, you don't want a half-broken install to launch until you have a successful install (which loads -w). So to summarize, the scripts should look like so:

preinstall:

> #!/bin/bash
>
> LAUNCHD=/Library/LaunchDaemons/edu.caltech.autonomy.foo.plist
> if [ -e "$LAUNCHD" && "$3" == "/" ]; then
>     launchctl unload "$LAUNCHD"
> fi

postinstall:

> #!/bin/bash
>
> if [ "$3" == "/" ]; then
>     launchctl load /Library/LaunchDaemons/edu.caltech.autonomy.foo.plist
> fi

--
Per Olofsson
System Administrator, ITS, University of Gothenburg

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Option to execute a command? (From: Nathan Sims <email@hidden>)
 >Re: Option to execute a command? (From: Per Olofsson <email@hidden>)
 >Re: Option to execute a command? (From: Nathan Sims <email@hidden>)
 >Re: Option to execute a command? (From: Greg Neagle <email@hidden>)
 >Re: Option to execute a command? (From: Nathan Sims <email@hidden>)
 >Re: Option to execute a command? (From: Greg Neagle <email@hidden>)
 >Re: Option to execute a command? (From: Karl Kuehn <email@hidden>)

  • Prev by Date: Re: Option to execute a command?
  • Next by Date: Re: Option to execute a command?
  • Previous by thread: Re: Option to execute a command?
  • Next by thread: Re: Option to execute a command?
  • Index(es):
    • Date
    • Thread