Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > core-release > by-pkgid > 7bfbd18f720d38da22ca8921c0f822ab > files > 7

dhcpxd-1.0.3-31.mga5.x86_64.rpm

#! /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