#!/bin/sh
PATH=/sbin:/usr/sbin:/bin:/usr/bin

# ifup-wlan0

if [ "$1" != daemon ] ; then
  # just in case a full path to the configuration file is passed in
  ifcfg=$(basename $1)
  shift
fi
shift

cd /etc/sysconfig/network-scripts
. network-functions

CONFIG=$1
DEVICE=$1
[ -f "$CONFIG" ] || CONFIG=ifcfg-$1
source_config

if [ "$2" = "boot" -a "${ONBOOT}" = "no" ]; then
  exit
fi

[ -x /etc/wlan-ng start $DEVICE ] || {
  echo "/etc/wlan-ng doesn't exist."
  echo "ifup-wlan0 for device $DEVICE exiting."
  exit 1
}

# bring up the wlan0 interface
/sbin/ifconfig $DEVICE netmask $NETMASK broadcast $BROADCAST
/sbin/route add default gw $NETWORK


