Revert "debug; disable init script"
[aiccu.git] / debian / aiccu.init.d
blob793f55547b8a0a77716473ebf5f7e1a19cc1456f
1 #! /bin/sh
3 # /etc/init.d/aiccu: start / stop AICCU
5 # Jeroen Massar <jeroen@sixxs.net>
7 ### BEGIN INIT INFO
8 # Provides: aiccu
9 # Required-Start: $local_fs $remote_fs $network $time $named
10 # Required-Stop: $local_fs $remote_fs $network $time $named
11 # Default-Start: 2 3 4 5
12 # Default-Stop: 0 1 6
13 # Short-Description: SixXS Automatic IPv6 Connectivity Client Utility
14 # Description:
15 # This client configures IPv6 connectivity without having to
16 # manually configure interfaces etc. A SixXS account or an account
17 # of another supported tunnel broker and at least one tunnel are
18 # required. These can be freely requested from the SixXS website
19 # at no cost. For more information about SixXS check their homepage.
20 ### END INIT INFO
22 PATH=/sbin:/bin:/usr/sbin:/usr/bin
23 NAME=aiccu
24 DAEMON=/usr/sbin/${NAME}
25 DESC="SixXS Automatic IPv6 Connectivity Client Utility (${NAME})"
26 BACKGROUND=true
28 # Options
29 OPTIONS=""
31 test -x $DAEMON || exit 0
33 . /lib/lsb/init-functions
35 if [ -f /etc/default/${NAME} ]; then
36 . /etc/default/${NAME}
39 # Verify that the configuration file exists
40 if [ ! -f /etc/aiccu.conf ]; then
41 echo "AICCU Configuration file /etc/aiccu.conf doesn't exist"
42 exit 0;
45 # Verify that the configuration is correct
46 if [ `grep -c "^username" /etc/aiccu.conf 2>/dev/null` -ne 1 ]; then
47 echo "AICCU is not configured, edit /etc/aiccu.conf first"
48 exit 0;
51 # Verify that it is in daemonize mode, otherwise it won't ever return
52 if [ `grep -c "^daemonize true" /etc/aiccu.conf 2>/dev/null` -ne 1 ]; then
53 echo "AICCU is not configured to daemonize on run"
54 exit 0;
57 if [ "$BACKGROUND" = "false" ]; then
58 exit 0;
61 case "$1" in
62 start)
63 log_begin_msg "Starting $DESC..."
64 start-stop-daemon --start --oknodo --quiet --exec $DAEMON -- start $OPTIONS
65 log_end_msg $?
67 stop)
68 log_begin_msg "Stopping $DESC..."
69 start-stop-daemon --stop --oknodo --quiet --exec $DAEMON -- stop
70 log_end_msg $?
72 restart|reload|force-reload)
73 log_begin_msg "Restarting $DESC..."
74 start-stop-daemon --stop --oknodo --quiet --exec $DAEMON -- stop
75 sleep 2
76 start-stop-daemon --start --oknodo --quiet --exec $DAEMON -- start $OPTIONS
77 log_end_msg $?
80 echo "Usage: /etc/init.d/$NAME {start|stop|reload|force-reload|restart}" >&2
81 exit 1
82 esac
84 exit 0