3 # /etc/init.d/aiccu: start / stop AICCU
5 # Jeroen Massar <jeroen@sixxs.net>
7 PATH
=/sbin
:/bin
:/usr
/sbin
:/usr
/bin
9 DAEMON
=/usr
/sbin
/${NAME}
10 DESC
="SixXS Automatic IPv6 Connectivity Client Utility (${NAME})"
16 test -x $DAEMON ||
exit 0
18 # Verify that the configuration file exists
19 if [ ! -f /etc
/aiccu.conf
]; then
20 echo "AICCU Configuration file /etc/aiccu.conf doesn't exist"
24 # Verify that the configuration is correct
25 if [ `grep -c "^username" /etc/aiccu.conf 2>/dev/null` -ne 1 ]; then
26 echo "AICCU is not configured, edit /etc/aiccu.conf first"
30 # Verify that it is in daemonize mode, otherwise it won't ever return
31 if [ `grep -c "^daemonize true" /etc/aiccu.conf 2>/dev/null` -ne 1 ]; then
32 echo "AICCU is not configured to daemonize on run"
36 if [ -f /etc
/default
/${NAME} ]; then
37 .
/etc
/default
/${NAME}
40 if [ "$BACKGROUND" = "false" ]; then
46 echo -n "Starting $DESC: "
47 start-stop-daemon
--start --oknodo --quiet --exec $DAEMON -- start
$OPTIONS
51 echo -n "Stopping $DESC: "
52 start-stop-daemon
--stop --oknodo --quiet --exec $DAEMON -- stop
55 restart|reload|force-reload
)
56 echo -n "Restarting $DESC: "
57 start-stop-daemon
--stop --oknodo --quiet --exec $DAEMON -- stop
59 start-stop-daemon
--start --oknodo --quiet --exec $DAEMON -- start
$OPTIONS
63 echo "Usage: /etc/init.d/$NAME {start|stop|reload|force-reload|restart}" >&2