From: Florent Bruneau Date: Wed, 1 Oct 2008 21:31:38 +0000 (+0200) Subject: Example of init script. X-Git-Url: http://git.madism.org/?p=apps%2Fpfixtools.git;a=commitdiff_plain;h=44dfcc42a03fdd403626e534ab279c9c63593e12 Example of init script. Signed-off-by: Florent Bruneau --- diff --git a/example/postlicyd.initd.sh b/example/postlicyd.initd.sh new file mode 100755 index 0000000..a9f5866 --- /dev/null +++ b/example/postlicyd.initd.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +die() { + echo "$1" + exit 1 +} + +POSTLICYD=/usr/sbin/postlicyd +PIDFILE=/var/run/postlicyd/pid +CONF=/etc/pfixtools/postlicyd.conf + +[ -z $1 ] && die "usage $0 (start|stop|reload)" + +case "$1" in + start) + $POSTLICYD -p "$PIDFILE" "$CONF" + ;; + + stop) + kill `cat $PIDFILE` + ;; + + reload) + kill -HUP `cat $PIDFILE` + ;; + + *) + die "usage $0 (start|stop|reload)" + ;; +esac