Example of init script.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Wed, 1 Oct 2008 21:31:38 +0000 (23:31 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Wed, 1 Oct 2008 21:31:38 +0000 (23:31 +0200)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
example/postlicyd.initd.sh [new file with mode: 0755]

diff --git a/example/postlicyd.initd.sh b/example/postlicyd.initd.sh
new file mode 100755 (executable)
index 0000000..a9f5866
--- /dev/null
@@ -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