forked from janpascal/denyhosts_sync
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdenyhosts-server.init.example
executable file
·71 lines (64 loc) · 1.85 KB
/
denyhosts-server.init.example
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#! /bin/sh
#
### BEGIN INIT INFO
# Provides: denyhosts-server
# Required-Start: $syslog $network $remote_fs
# Required-Stop: $syslog $network $remote_fs
# Should-Start: mysql
# Should-Stop: mysql
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: DenyHosts synchronisation service
# Description: Service that allows DenyHosts clients to share blocked IP
# addresses.
### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/bin/denyhosts-server
DESC="DenyHosts sync server"
NAME=`basename $DAEMON`
PIDFILE=/var/run/$NAME.pid
DAEMONUSER=denyhosts-server
CONFIG_FILE=/etc/denyhosts-server.conf
QUIET=--quiet
test -x $DAEMON || exit 0
# Include defaults if available
if [ -f /etc/default/denyhosts-server ] ; then
. /etc/default/denyhosts-server
fi
DAEMON_ARGS="-c $CONFIG_FILE"
#set -e
. /lib/lsb/init-functions
case "$1" in
start)
log_begin_msg "Starting $DESC: $NAME"
start-stop-daemon --start $QUIET --chuid $DAEMONUSER \
--make-pidfile --pidfile $PIDFILE --background \
--startas /bin/bash -- -c "exec $DAEMON $DAEMON_ARGS >> /var/log/denyhosts-server/console.log 2>&1"
log_end_msg $?
;;
stop)
log_begin_msg "Stopping $DESC: $NAME"
start-stop-daemon --stop $QUIET --chuid $DAEMONUSER \
--pidfile $PIDFILE \
--startas /bin/bash -- -c "exec $DAEMON $DAEMON_ARGS >> /var/log/denyhosts-server/console.log 2>&1"
log_end_msg $?
;;
restart)
$0 stop
$0 start
;;
status)
status_of_proc "$DAEMON" $NAME
;;
reload|force-reload)
log_begin_msg "Reloading $DESC: $NAME"
start-stop-daemon --stop --signal HUP --pidfile $PIDFILE
log_end_msg $?
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
exit 1
;;
esac
exit 0