#! /bin/sh # This script sets up slave interfaces # Slave interfaces are those that have the same network and IP # but the interface that has the gateway attached is the master # interface. This allows intranet binding. # # To enable a slave interface, make the file INTERFACE.slave # file with the interface(s) listed. VAR="" [ "$1 $ACTION" = "post init" ] && VAR="1" [ "$1 $ACTION" = "post open" ] && VAR="1" [ "$1 $ACTION" = "post update" ] && VAR="1" [ "$1 $ACTION" = "pre close" ] && VAR="1" if [ "$VAR" ] ; then if [ -f "$MAINPATH/$INTERFACE.slave" ] ; then for SLAVE in `cat "$MAINPATH/$INTERFACE.slave"` ; do BASE=`echo "$SLAVE" | sed -e "s,:.*,,"` { if [ -f "$MAINPATH/$INTERFACE.info" ] ; then cat "$MAINPATH/$INTERFACE.info" fi echo "INTERFACE=\"$SLAVE\"" echo "BASEINTERFACE=\"$BASE\"" } > "$MAINPATH/$SLAVE.info" { cat "$MAINPATH/$INTERFACE.pars" echo "ADDHOST=\"\"" echo "ADDNAMESERVER=\"\"" echo "ADDGATEWAY=\"\"" echo "NETMASK=\"255.255.255.255\"" } > "$MAINPATH/$SLAVE.pars" $0 "$ACTION" "$SLAVE" "$BASE" "$MAINPATH" done fi fi