~ubuntu-branches/ubuntu/saucy/radvd/saucy

« back to all changes in this revision

Viewing changes to debian/init

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Rottmann
  • Date: 2002-04-03 11:21:14 UTC
  • Revision ID: james.westby@ubuntu.com-20020403112114-22ic7g2j00colvmx
Tags: 1:0.7.1-5
Corrected spelling in package description. (closes: #140978)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
 
 
3
PATH=/sbin:/bin:/usr/sbin:/usr/bin
 
4
DAEMON=/usr/sbin/radvd
 
5
NAME=radvd
 
6
DESC=radvd
 
7
CONFIG=/etc/radvd.conf
 
8
 
 
9
test -x $DAEMON || exit 0
 
10
 
 
11
set -e
 
12
 
 
13
# We must enable IPv6 forwarding for radvd to work
 
14
echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
 
15
 
 
16
chkconfig() {
 
17
    if [ ! -e $CONFIG ]; then
 
18
        echo "$CONFIG does NOT exist." && exit 1
 
19
    elif [ ! -s $CONFIG ]; then
 
20
        echo "$CONFIG is empty." && exit 1
 
21
    fi
 
22
}
 
23
 
 
24
case "$1" in
 
25
  start)
 
26
        echo -n "Starting $DESC: "
 
27
        chkconfig
 
28
        if ! start-stop-daemon --oknodo --start --pidfile /var/run/$NAME.pid \
 
29
                --exec $DAEMON; then
 
30
          echo "failed." && exit 1
 
31
        fi
 
32
        echo "$NAME."
 
33
        ;;
 
34
  stop)
 
35
        echo -n "Stopping $DESC: "
 
36
        start-stop-daemon --oknodo --stop --pidfile /var/run/$NAME.pid \
 
37
                --exec $DAEMON
 
38
        echo "$NAME."
 
39
        ;;
 
40
  reload|force-reload)
 
41
        echo "Reloading $DESC configuration files."
 
42
        start-stop-daemon --stop --signal HUP --quiet --pidfile \
 
43
            /var/run/$NAME.pid --exec $DAEMON
 
44
        
 
45
        ;;
 
46
  restart)
 
47
        echo -n "Restarting $DESC: "
 
48
        start-stop-daemon --stop --quiet --pidfile \
 
49
                /var/run/$NAME.pid --exec $DAEMON
 
50
        sleep 1
 
51
        start-stop-daemon --start --quiet --pidfile \
 
52
                /var/run/$NAME.pid --exec $DAEMON
 
53
        echo "$NAME."
 
54
        ;;
 
55
  *)
 
56
        N=/etc/init.d/$NAME
 
57
        echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
 
58
        exit 1
 
59
        ;;
 
60
esac
 
61
 
 
62
exit 0