PageRenderTime 168ms CodeModel.GetById 165ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/init.d/courier-authdaemon

http://github.com/brinkman83/bashrc
Shell | 52 lines | 36 code | 4 blank | 12 comment | 2 complexity | eefeb40bb735cd2430db1f1fd929b2b9 MD5 | raw file
 1#! /bin/sh -e
 2#
 3### BEGIN INIT INFO
 4# Provides:          courier-authdaemon
 5# Required-Start:    $remote_fs $syslog
 6# Required-Stop:     $remote_fs $syslog
 7# Default-Start:     2 3 4 5
 8# Default-Stop:      0 1 6
 9### END INIT INFO
10
11prefix="/usr"
12exec_prefix=${prefix}
13sysconfdir="/etc/courier"
14sbindir="${exec_prefix}/sbin"
15daemonscript="${sbindir}/authdaemond"
16rundir="/var/run/courier/authdaemon"
17
18. /lib/lsb/init-functions
19
20# Check for a leftover init script
21if [ ! -x $daemonscript ]; then
22	exit 0
23fi
24
25case "$1" in
26start)
27	# Start daemon.
28	cd /
29	log_daemon_msg "Starting Courier authentication services" "authdaemond"
30	if [ ! -d "$rundir" ]; then
31		mkdir -p -m 0750 $rundir 
32	fi
33	$daemonscript start
34	log_end_msg 0
35	;;
36stop)
37	# Stop daemon.
38	cd /
39	log_daemon_msg "Stopping Courier authentication services" "authdaemond"
40	$daemonscript stop
41	log_end_msg 0
42    ;;
43restart|force-reload)
44	$0 stop
45	$0 start
46    ;;
47*)
48	echo "Usage: $0 {start|stop|restart|force-reload}" >&2
49	exit 2
50	;;
51esac
52exit 0