File: preinstall.sh

package info (click to toggle)
ngircd 25-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,736 kB
  • sloc: ansic: 19,041; sh: 5,175; makefile: 655; xml: 220
file content (25 lines) | stat: -rwxr-xr-x 728 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh
# ngIRCd Mac OS X preinstall/preupgrade script

LDPLIST="/Library/LaunchDaemons/de.barton.ngircd.plist"

rm -f /tmp/ngircd_needs_restart || exit 1
if [ -r "$LDPLIST" ]; then
	echo "LaunchDaemon script found, checking status ..."
	launchctl list | fgrep "de.barton.ngIRCd" >/dev/null 2>&1
	if [ $? -eq 0 ]; then
		# ngIRCd is already running; stop it and touch a
		# "stamp file" so that we know that we have to
		# restart it after installation/upgrade.
		echo "ngIRCd is already running; stop it ..."
		launchctl unload "$LDPLIST" || exit 1
		echo "Daemon has been stopped."
		touch /tmp/ngircd_needs_restart || exit 1
	else
		echo "ngIRCd is not running."
	fi
else
	echo "LaunchDaemon script not found."
fi

# -eof-