blob: 1e4abd9751b1ce6b4f448daffb3d683b28a4cb85 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#!/bin/sh
#
# /etc/rc.d/knockd: start/stop port knock daemon
#
SSD=/sbin/start-stop-daemon
PROG=/usr/sbin/knockd
NAME=knockd
case $1 in
start)
$SSD --start -bC --exec $PROG
;;
stop)
$SSD --stop --retry 10 --name=$NAME
;;
restart)
$0 stop
$0 start
;;
status)
$SSD --status --name=$NAME
case $? in
0) echo "$PROG is running" ;;
1) echo "$PROG is not running" ;;
3) echo "$PROG is not running" ;;
4) echo "Unable to determine the program status" ;;
esac
;;
*)
echo "usage: $0 [start|stop|restart|status]"
;;
esac
# End of file
|