--- trunk/magellan-initscripts/etc/rc.d/init.d/network 2005/10/10 18:43:03 268 +++ trunk/magellan-initscripts/etc/rc.d/init.d/network 2005/10/11 11:19:58 270 @@ -1,5 +1,5 @@ #!/bin/bash -# $Header: /home/cvsd/magellan-cvs/magellan-src/magellan-initscripts/etc/rc.d/init.d/network,v 1.9 2005-10-10 18:43:03 niro Exp $ +# $Header: /home/cvsd/magellan-cvs/magellan-src/magellan-initscripts/etc/rc.d/init.d/network,v 1.10 2005-10-11 11:19:58 niro Exp $ #%rlevels: 0:k 1:k 2:k 3:s 4:s 5:s 6:k #%start: 20 @@ -141,6 +141,10 @@ return 1 fi + ${CURS_UP} + ${SET_WWCOL} + echo "[AUTH: WEP]" + iwconfig "${iface}" enc on [[ -n ${WIRELESS_KEY_LENGTH} ]] && iwconfig "${iface}" enc "${WIRELESS_KEY_LENGTH}" [[ -n ${WIRELESS_KEY} ]] && iwconfig "${iface}" key "${WIRELESS_KEY}" @@ -163,6 +167,10 @@ return 1 fi + ${CURS_UP} + ${SET_WWCOL} + echo "[AUTH: WPA]" + # get default settings [[ -f /etc/conf.d/wpa_supplicant ]] && source /etc/conf.d/wpa_supplicant @@ -194,6 +202,10 @@ -c"${WIRELESS_WPA_CONFIG}" \ -i"${iface}" \ ${WIRELESS_WPA_OPTS} + + # echo wait 5 seconds + echo " Waiting 5 seconds to retrieve authentification reply ... " + sleep 5 } setup_wireless_extensions() @@ -206,6 +218,8 @@ return 1 fi + echo -e ${COLOREDSTAR}"Setting up wlan-ext for ${COLBLUE}${iface}${COLDEFAULT} ... " + [[ -n ${WIRELESS_BITRATE} ]] && iwconfig "${iface}" rate "${WIRELESS_BITRATE}" [[ -n ${WIRELESS_CHANNEL} ]] && iwconfig "${iface}" channel "${WIRELESS_CHANNEL}" [[ -n ${WIRELESS_ESSID} ]] && iwconfig "${iface}" essid "${WIRELESS_ESSID}" @@ -231,10 +245,21 @@ source ${network_settings}/net.${iface} || exit 1 checkconfig - echo -e ${COLOREDSTAR}"Bringing up interface ${COLBLUE}${iface}${COLDEFAULT} ..." - # setup mac - [ -n "${FORCE_MAC_TO}" ] && ifconfig ${iface} hw ether "${FORCE_MAC_TO}" + if [ -n "${FORCE_MAC_TO}" ] + then + echo -e ${COLOREDSTAR}"Faking MAC to ${FORCE_MAC_TO} for ${COLBLUE}${iface}${COLDEFAULT} ... " + ifconfig "${iface}" hw ether "${FORCE_MAC_TO}" + evaluate_retval + fi + + # activate the interface + ifconfig "${iface}" up + + # now configure wireless_extensions + [ -x /usr/sbin/iwconfig ] && setup_wireless_extensions "${iface}" + + echo -e ${COLOREDSTAR}"Bringing up interface ${COLBLUE}${iface}${COLDEFAULT} ..." # setup static or dhcp case ${NETWORKING} in @@ -273,12 +298,6 @@ echo "nameserver ${dns}" >> /etc/resolv.conf done fi - - # setup wlan extensions - if [ -x /usr/sbin/iwconfig ] - then - setup_wireless_extensions "${iface}" - fi done } @@ -308,7 +327,7 @@ ${CURS_UP} ${SET_WWCOL} echo "[$(basename ${DHCP_PROG})]" - ${DHCP_PROG} ${DHCP_STOP} + ${DHCP_PROG} ${DHCP_STOP} "${iface}" evaluate_retval fi @@ -318,6 +337,12 @@ killall wpa_supplicant fi done + + # remove state dir + if [ -d /var/run/wpa_supplicant ] + then + rm -rf /var/run/wpa_supplicant + fi } case $1 in