Browse Source

Simple startstop script for konfd

git-svn-id: https://klish.googlecode.com/svn/trunk@390 0eaa4687-2ee9-07dd-09d9-bcdd2d2dd5fb
Serj Kalichev 13 years ago
parent
commit
d800dafbe9
1 changed files with 24 additions and 0 deletions
  1. 24 0
      contrib/konfd.init

+ 24 - 0
contrib/konfd.init

@@ -0,0 +1,24 @@
+#!/bin/sh
+
+# Check for missing binaries
+BIN=/usr/bin/konfd
+test -x $BIN || exit 5
+
+PID=/var/run/konfd.pid
+
+case "$1" in
+start)
+	echo "Starting konfd daemon..."
+	test -r $PID && { echo "The service is already running."; exit 1; }
+	$BIN -p $PID
+	;;
+stop)
+	echo "Stopping konfd daemon..."
+	test ! -r $PID && { echo "The service is not running."; exit 1; }
+	kill $(cat $PID)
+	;;
+*)
+	echo "Usage: $0 {start|stop}"
+	exit 1
+	;;
+esac