2 # ngIRCd Mac OS X preinstall/preupgrade script
4 LDPLIST="/Library/LaunchDaemons/de.barton.ngircd.plist"
6 rm -f /tmp/ngircd_needs_restart || exit 1
7 if [ -r "$LDPLIST" ]; then
8 echo "LaunchDaemon script found, checking status ..."
9 launchctl list | fgrep "de.barton.ngIRCd" >/dev/null 2>&1
11 # ngIRCd is already running; stop it and touch a
12 # "stamp file" so that we know that we have to
13 # restart it after installation/upgrade.
14 echo "ngIRCd is already running; stop it ..."
15 launchctl unload "$LDPLIST" || exit 1
16 echo "Daemon has been stopped."
17 touch /tmp/ngircd_needs_restart || exit 1
19 echo "ngIRCd is not running."
22 echo "LaunchDaemon script not found."