summaryrefslogtreecommitdiffstats
path: root/redhat/ldpd.init
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2016-09-12 21:54:56 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-09-23 15:31:17 +0200
commitb021388f4267691b6d59be5b63a6c8b46baf2448 (patch)
tree4b0d3363fc18f810e5dd7ec3e7bcba19c6abbba2 /redhat/ldpd.init
parentbuild: fix package generation on CentOS 7 (diff)
downloadfrr-b021388f4267691b6d59be5b63a6c8b46baf2448.tar.xz
frr-b021388f4267691b6d59be5b63a6c8b46baf2448.zip
distro/redhat: add mpls and ldpd
Diffstat (limited to 'redhat/ldpd.init')
-rw-r--r--redhat/ldpd.init72
1 files changed, 72 insertions, 0 deletions
diff --git a/redhat/ldpd.init b/redhat/ldpd.init
new file mode 100644
index 000000000..b9b9538cb
--- /dev/null
+++ b/redhat/ldpd.init
@@ -0,0 +1,72 @@
+#!/bin/bash
+# chkconfig: - 16 84
+# config: /etc/quagga/ldpd.conf
+
+### BEGIN INIT INFO
+# Provides: ldpd
+# Short-Description: LDP engine
+# Description: LDP engine for use with Zebra
+### END INIT INFO
+
+# source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# quagga command line options
+. /etc/sysconfig/quagga
+
+RETVAL=0
+PROG="ldpd"
+cmd=ldpd
+LOCK_FILE=/var/lock/subsys/ldpd
+CONF_FILE=/etc/quagga/ldpd.conf
+
+case "$1" in
+ start)
+ # Check that networking is up.
+ [ "${NETWORKING}" = "no" ] && exit 1
+
+ # The process must be configured first.
+ [ -f $CONF_FILE ] || exit 6
+ if [ `id -u` -ne 0 ]; then
+ echo $"Insufficient privilege" 1>&2
+ exit 4
+ fi
+
+ echo -n $"Starting $PROG: "
+ daemon $cmd -d $LDPD_OPTS -f $CONF_FILE
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch $LOCK_FILE
+ echo
+ ;;
+ stop)
+ echo -n $"Shutting down $PROG: "
+ killproc $cmd
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && rm -f $LOCK_FILE
+ echo
+ ;;
+ restart|reload|force-reload)
+ $0 stop
+ $0 start
+ RETVAL=$?
+ ;;
+ condrestart|try-restart)
+ if [ -f $LOCK_FILE ]; then
+ $0 stop
+ $0 start
+ fi
+ RETVAL=$?
+ ;;
+ status)
+ status $cmd
+ RETVAL=$?
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart|reload|force-reload|condrestart|try-restart|status}"
+ exit 2
+esac
+
+exit $RETVAL