]>
Commit | Line | Data |
---|---|---|
281b6206 JR |
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 database, \ | |
9 | # and protocol modules supporting multiple routing protocols (RIP \ | |
10 | # versions 1 and 2, DCN HELLO, OSPF version 2, EGP version 2 and BGP \ | |
11 | # 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. | |
88cb07df | 23 | if is_yes "${NETWORKING}"; then |
24 | if [ ! -f /var/lock/subsys/network ]; then | |
25 | msg_network_down gated | |
26 | exit 1 | |
27 | fi | |
28 | else | |
29 | exit 0 | |
30 | fi | |
281b6206 JR |
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) | |
88cb07df | 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 | |
88cb07df | 48 | fi |
49 | ;; | |
281b6206 | 50 | stop) |
88cb07df | 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 | |
88cb07df | 60 | fi |
61 | ;; | |
281b6206 JR |
62 | status) |
63 | $gdc running | |
64 | ;; | |
79353712 | 65 | reload|force-reload) |
281b6206 JR |
66 | $gdc reconfig |
67 | ;; | |
68 | restart) | |
69 | $gdc restart | |
70 | ;; | |
71 | *) | |
79353712 | 72 | msg_usage "$0 {start|stop|restart|reload|force-reload|status}" |
73 | exit 3 | |
281b6206 JR |
74 | esac |
75 | ||
76 | exit 0 |