From 44dfcc42a03fdd403626e534ab279c9c63593e12 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Wed, 1 Oct 2008 23:31:38 +0200 Subject: [PATCH] Example of init script. Signed-off-by: Florent Bruneau --- example/postlicyd.initd.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 example/postlicyd.initd.sh 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 -- 2.20.1