aboutsummaryrefslogtreecommitdiff
path: root/network/knock/rc.knockd.new
diff options
context:
space:
mode:
authorJoey Trungale <joey@trungale.net>2010-05-12 23:32:20 +0200
committerDavid Somero <xgizzmo@slackbuilds.org>2010-05-12 23:32:20 +0200
commit43858c38016b71d1112b70f70a4c37755140af55 (patch)
treed2c48a92afd45085341b53df22eff71d6132fd14 /network/knock/rc.knockd.new
parent4a3fd527941ac66e06f4e54ee1dcffe531dbfdff (diff)
network/knock: Added to 12.2 repository
Diffstat (limited to 'network/knock/rc.knockd.new')
-rw-r--r--network/knock/rc.knockd.new41
1 files changed, 41 insertions, 0 deletions
diff --git a/network/knock/rc.knockd.new b/network/knock/rc.knockd.new
new file mode 100644
index 0000000000000..5198603ffbc76
--- /dev/null
+++ b/network/knock/rc.knockd.new
@@ -0,0 +1,41 @@
+#!/bin/sh
+# Start/stop/restart knockd.
+
+# Start knockd:
+knockd_start() {
+ CMDLINE="/usr/sbin/knockd -d"
+ echo -n "Starting knock daemon: $CMDLINE "
+ $CMDLINE
+ echo
+}
+
+# Stop knockd:
+knockd_stop() {
+ echo -n "Stopping knock daemon..."
+ kill `cat /var/run/knockd.pid`
+ echo
+ sleep 1
+ rm -f /var/run/knockd.pid
+ killall knockd 2> /dev/null
+}
+
+# Restart knockd:
+knockd_restart() {
+ knockd_stop
+ sleep 1
+ knockd_start
+}
+
+case "$1" in
+'start')
+ knockd_start
+ ;;
+'stop')
+ knockd_stop
+ ;;
+'restart')
+ knockd_restart
+ ;;
+*)
+ echo "usage $0 start|stop|restart"
+esac