<< | Thread Index | >> ]    [ << | Date Index | >> ]

Subject: multiple cipes
From: <brian,AT,thatsmell,DOT,com>
Date: Mon, 5 Feb 2001 20:32:58 +0100

This is a resend of an email I sent a little while ago about this
problem....

This is not an e-mail regarding a problem.  I saw a couple of email's
mentioning similar situations.
I have a dual P3-800 running RH7 that is acting as a gateway to our 3 remote
offices.  It has 3 instances of cipe running.  I also setup RIP via Zebra,
so I don't have to worry about routing tables.  I also modified the redhat
startup script to be able to handle multiple instances of cipe.  It looks
for all options.* files in /etc/cipe and tries to start them all.  I have
included the script below.  You can also selectively start/stop/restart
specific daemons.  Ex.  '/etc/rc.d/init.d/ciped restart cipcb1' will only
restart cipcb1 connection leaving cipcb0 and cipcb2 alone.  Any
questions/comments feel free to send them.

        Brian Roach

#!/bin/sh
#
# Startup script for the CIPE VPN
#
# chkconfig: 345 11 89
# description: CIPE is used to create encrypted IP-IP.
# processname: ciped-cb
# pidfile: /var/run/cipcb*.pid
# config: /etc/cipe/options.cipcb*

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Which connections are we handling?
# Default is all
if [ -z $2 ] ; then
        CONN=`ls -1 /etc/cipe | grep -w -eoptions | sed -e s/options\.//`
else
        CONN=$2
fi

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

RETVAL=0

start() {
        for each in $CONN; do
        if [ -f /var/run/$each.pid ] ; then
                echo "CIPE interface " $each " is already running"
                exit 1
        fi
        action "Starting CIPE interface $each: " /usr/sbin/ciped-cb -o
/etc/cipe/options.$each
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ciped.$each
        done
}

stop() {
        for each in $CONN; do
        action "Shutting down CIPED interface $each: " [ -f 
/var/run/$each.pid ] &&
kill `eval cat /var/run/$each.pid`
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ciped.$each
        done
}

# See how we were called.
case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    status)
        status ciped-cb
        RETVAL=$?
        ;;
    restart)
        stop
        start
        RETVAL=$?
        ;;
    condrestart)
        CONN=`ls -1 /var/lock/subsys | grep -w -eciped | sed -e s/ciped\.//`
            stop
            start
        ;;
    reload)
        stop
        start
        ;;
    *)
        echo "Usage: $0 {start|stop|restart|reload|status}"
        RETVAL=1
esac

exit $RETVAL

--
Message sent by the cipe-l,AT,inka,DOT,de mailing list.
Unsubscribe: mail majordomo,AT,inka,DOT,de, "unsubscribe cipe-l" in body
Other commands available with "help" in body to the same address.
CIPE info and list archive:
<URL:http://sites.inka.de/~bigred/devel/cipe.html>





<< | Thread Index | >> ]    [ << | Date Index | >> ]