--- /dev/null
+#!/bin/sh
+# $Id$
+#
+# wavelan Configure WaveLAN interfaces
+#
+# chkconfig: 2345 50 11
+# description: This script take care of setting rights params
+# wavelan cards.
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+case "$1" in
+ start)
+ show "Setting WaveLAN interfaces"
+ busy
+ interfaces_boot=$((cd /etc/sysconfig/interfaces && ls -1 ifcfg* | \
+ egrep -v '(ifcfg-lo|ifcfg-sit|ifcfg-atm|ifcfg-lec|ifcfg-nas|:)' | \
+ egrep 'ifcfg-[a-z0-9\.]+$' | xargs egrep -l "ONBOOT=[^n][^o]" | \
+ awk ' { gsub(/ifcfg-/,NIL); print $0 } ') 2> /dev/null)
+
+ for i in $interfaces_boot ; do
+ # cleaning all vars
+ INFO=""
+ ESSID=""
+ NWID=""
+ MODE=""
+ FREQ=""
+ CHANNEL=""
+ SENS=""
+ RATE=""
+ KEY=""
+ RTS=""
+ FRAG=""
+ NICKNAME=""
+
+ . /etc/sysconfig/interfaces/ifcfg-$i
+ # Mode need to be first : some settings apply only in a specific mode !
+ if [ -n "$MODE" ] ; then
+ /usr/sbin/iwconfig $i mode $MODE >/dev/null 2>&1
+ fi
+
+ # This is a bit hackish, but should do the job right...
+ if [ ! -n "$NICKNAME" ] ; then
+ NICKNAME=`/bin/hostname`
+ fi
+ if [ -n "$ESSID" -o -n "$MODE" ] ; then
+ /usr/sbin/iwconfig $i nick $NICKNAME >/dev/null 2>&1
+ fi
+
+ # Regular stuff...
+ if [ -n "$NWID" ] ; then
+ /usr/sbin/iwconfig $i nwid $NWID >/dev/null 2>&1
+ fi
+ if [ -n "$FREQ" ] ; then
+ /usr/sbin/iwconfig $i freq $FREQ >/dev/null 2>&1
+ elif [ -n "$CHANNEL" ] ; then
+ /usr/sbin/iwconfig $i channel $CHANNEL >/dev/null 2>&1
+ fi
+ if [ -n "$SENS" ] ; then
+ /usr/sbin/iwconfig $i sens $SENS >/dev/null 2>&1
+ fi
+ if [ -n "$RATE" ] ; then
+ /usr/sbin/iwconfig $i rate $RATE >/dev/null 2>&1
+ fi
+ if [ -n "$KEY" ] ; then
+ /usr/sbin/iwconfig $i key $KEY >/dev/null 2>&1
+ fi
+ if [ -n "$RTS" ] ; then
+ /usr/sbin/iwconfig $i rts $RTS >/dev/null 2>&1
+ fi
+ if [ -n "$FRAG" ] ; then
+ /usr/sbin/iwconfig $i frag $FRAG >/dev/null 2>&1
+ fi
+
+ # ESSID need to be last : most device re-perform the scanning/discovery
+ # when this is set, and things like encryption keys are better be
+ # defined if we want to discover the right set of APs/nodes.
+ if [ -n "$ESSID" ] ; then
+ /usr/sbin/iwconfig $i essid $ESSID >/dev/null 2>&1
+ fi
+ done
+ deltext
+ ok
+ ;;
+ reload)
+ $0 start
+ ;;
+ *)
+ echo "Usage: $0 {start|reload}"
+esac