]> git.proxmox.com Git - mirror_frr.git/blame - redhat/pimd.init
Merge pull request #468 from qlyoung/fix-list-perm
[mirror_frr.git] / redhat / pimd.init
CommitLineData
dba5a062
MW
1#!/bin/bash
2# chkconfig: - 16 84
c115e4a4 3# config: /etc/frr/pimd.conf
dba5a062
MW
4
5### BEGIN INIT INFO
6# Provides: pimd
7# Short-Description: PIM multicast routing engine
8# Description: PIM routing engine for use with Zebra
9### END INIT INFO
10
11# source function library
12. /etc/rc.d/init.d/functions
13
14# Get network config
15. /etc/sysconfig/network
16
c115e4a4
MW
17# frr command line options
18. /etc/sysconfig/frr
dba5a062
MW
19
20RETVAL=0
21PROG="pimd"
22cmd=pimd
23LOCK_FILE=/var/lock/subsys/pimd
c115e4a4 24CONF_FILE=/etc/frr/pimd.conf
dba5a062
MW
25
26case "$1" in
27 start)
28 # Check that networking is up.
29 [ "${NETWORKING}" = "no" ] && exit 1
30
31 # The process must be configured first.
32 [ -f $CONF_FILE ] || exit 6
33 if [ `id -u` -ne 0 ]; then
34 echo $"Insufficient privilege" 1>&2
35 exit 4
36 fi
37
38 echo -n $"Starting $PROG: "
39 daemon $cmd -d $PIMD_OPTS -f $CONF_FILE
40 RETVAL=$?
41 [ $RETVAL -eq 0 ] && touch $LOCK_FILE
42 echo
43 ;;
44 stop)
45 echo -n $"Shutting down $PROG: "
46 killproc $cmd
47 RETVAL=$?
48 [ $RETVAL -eq 0 ] && rm -f $LOCK_FILE
49 echo
50 ;;
51 restart|reload|force-reload)
52 $0 stop
53 $0 start
54 RETVAL=$?
55 ;;
56 condrestart|try-restart)
57 if [ -f $LOCK_FILE ]; then
58 $0 stop
59 $0 start
60 fi
61 RETVAL=$?
62 ;;
63 status)
64 status $cmd
65 RETVAL=$?
66 ;;
67 *)
68 echo $"Usage: $0 {start|stop|restart|reload|force-reload|condrestart|try-restart|status}"
69 exit 2
70esac
71
72exit $RETVAL