#!/bin/sh # # gated This script is used to start/stop the gated routing # daemon # # chkconfig: - 32 75 # description: Starts and stops gated (routing daemon). GateD is a modular \ # software program consisting of core services, a routing \ # database, and protocol modules supporting multiple routing \ # protocols (RIP versions 1 and 2, DCN HELLO, OSPF version 2, \ # EGP version 2 and BGP version 2 through 4) # processname: gated # pidfile: /var/run/gated.pid # config: /etc/gated.conf # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. if is_yes "${NETWORKING}"; then if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then msg_network_down gated exit 1 fi else exit 0 fi gdc=/usr/bin/gdc [ -f /etc/gated.conf ] || exit 0 [ -f $gdc ] || exit 0 PATH=$PATH:/usr/bin:/usr/sbin # See how we were called. case "$1" in start) if [ ! -f /var/lock/subsys/gated ]; then msg_starting gated daemon gated touch /var/lock/subsys/gated else msg_already_running gated fi ;; stop) if [ -f /var/lock/subsys/gated ]; then # Stop daemons. msg_stopping gated busy $gdc stop ok rm -f /var/lock/subsys/gated else msg_not_running gopherd fi ;; status) $gdc running ;; reload|force-reload) $gdc reconfig ;; restart) $gdc restart ;; *) msg_usage "$0 {start|stop|restart|reload|force-reload|status}" exit 3 esac exit 0