]> git.pld-linux.org Git - packages/gated.git/blob - gated.init
- dropped pre-cvs changelog
[packages/gated.git] / gated.init
1 #!/bin/sh
2 #
3 # gated         This script is used to start/stop the gated routing
4 #               daemon
5 #
6 # chkconfig:    - 32 75
7 # description:  Starts and stops gated (routing daemon). GateD is a modular \
8 #               software program consisting of core services, a routing \
9 #               database, and protocol modules supporting multiple routing \
10 #               protocols (RIP versions 1 and 2, DCN HELLO, OSPF version 2, \
11 #               EGP version 2 and BGP version 2 through 4)
12 # processname:  gated
13 # pidfile:      /var/run/gated.pid
14 # config:       /etc/gated.conf
15
16 # Source function library.
17 . /etc/rc.d/init.d/functions
18
19 # Source networking configuration.
20 . /etc/sysconfig/network
21
22 # Check that networking is up.
23 if is_yes "${NETWORKING}"; then
24         if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
25                 msg_network_down gated
26                 exit 1
27         fi
28 else
29         exit 0
30 fi
31
32 gdc=/usr/bin/gdc
33
34 [ -f /etc/gated.conf ] || exit 0
35 [ -f $gdc ] || exit 0
36
37 PATH=$PATH:/usr/bin:/usr/sbin
38
39 # See how we were called.
40 case "$1" in
41   start)
42         if [ ! -f /var/lock/subsys/gated ]; then
43                 msg_starting gated
44                 daemon gated
45                 touch /var/lock/subsys/gated
46         else
47                 msg_already_running gated
48         fi
49         ;;
50   stop)
51         if [ -f /var/lock/subsys/gated ]; then
52                 # Stop daemons.
53                 msg_stopping gated
54                 busy
55                 $gdc stop
56                 ok
57                 rm -f /var/lock/subsys/gated
58         else
59                 msg_not_running gopherd
60         fi
61         ;;
62   status)
63         $gdc running
64         ;;
65   reload|force-reload)
66         $gdc reconfig
67         ;;
68   restart)
69         $gdc restart
70         ;;
71   *)
72         msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
73         exit 3
74 esac
75
76 exit 0
This page took 0.086219 seconds and 3 git commands to generate.