#!/bin/sh
#
#  ifup [interface name|definition file]
#
. /usr/share/ifupfn.sh

case "$1" in
  "")  #take the interface definitions from the environment
    [ "${DEVICE}" ] || usage
    ifup_function
  ;;
  
  */*) #assume anything with a / is the path to an interface definition file
    unset DEVICE BOOTPROTO IPADDR NETMASK BROADCAST DHCPNAME
    unset NETWORK GATEWAY NSprepCMD
    . $1
    ifup_function
  ;;
  
  -*)  #any flag is a request for help
    usage    
  ;;
  
  *) #anything else must be the name of an interface
    unset DEVICE BOOTPROTO IPADDR NETMASK BROADCAST DHCPNAME
    unset NETWORK GATEWAY NSprepCmd
    . /etc/sysconfig/ifcfg-$1
    ifup_function
  ;;
esac
