#!/bin/sh # # dhcpd This shell script takes care of starting and stopping # ip masqing # # chkconfig: - 13 85 # description: ipmasq provides routing for the subnodes of the cluster # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network RETVAL=0 kver=$(uname -r) kmajor=${kver%${kver#[0-9].[0-9]}} # See how we were called. case "$1" in start) # Start daemons. echo -n "Starting IP Masq: " daemon /usr/local/encap/ipmasq-${kmajor}/sbin/ipmasq-up RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ipmasq ;; stop) # Stop daemons. echo -n "Shutting down IP Masq: " daemon /usr/local/encap/ipmasq-${kmajor}/sbin/ipmasq-down RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ipmasq ;; restart|reload) $0 stop $0 start RETVAL=$? ;; status) status ipmasq RETVAL=$? ;; *) echo "Usage: ipmasq {start|stop|restart|status}" exit 1 esac exit $RETVAL