From 57561b54fba53f5cfc8b6831fc1b84b1670ce88f Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Wed, 14 Jun 2006 14:48:07 +0000 Subject: Add a check to determine the location of iwconfig so it works on older and newer versions of wireless-tools. This is for bug #136497. git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/livecd-tools/trunk@106 7bf51bff-881f-0410-a643-fba68b97345e --- livecd-functions.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/livecd-functions.sh b/livecd-functions.sh index be8c557..2dd6a7e 100755 --- a/livecd-functions.sh +++ b/livecd-functions.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/livecd-tools/livecd-functions.sh,v 1.23 2006/05/30 20:20:11 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/livecd-tools/livecd-functions.sh,v 1.24 2006/06/14 14:48:07 wolf31o2 Exp $ # Global Variables: # CDBOOT -- is booting off CD @@ -123,6 +123,8 @@ get_video_cards() { livecd_config_wireless() { cd /tmp/setup.opts + [ -x /usr/sbin/iwconfig ] && iwconfig=/usr/sbin/iwconfig + [ -x /sbin/iwconfig ] && iwconfig=/sbin/iwconfig dialog --title "SSID" --inputbox "Please enter your SSID, or leave blank for selecting the nearest open network" 20 50 2> ${iface}.SSID SSID="$(cat ${iface}.SSID)" if [ -n "${SSID}" ] @@ -137,26 +139,26 @@ livecd_config_wireless() { 1) dialog --title "WEP (Part 3)" --inputbox "Please enter your WEP key in the form of XXXX-XXXX-XX for 64-bit or XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XX for 128-bit" 20 50 2> ${iface}.WEPKEY WEP_KEY="$(cat ${iface}.WEPKEY)" - if [ -n "${WEP_KEY}" -a -x /usr/sbin/iwconfig ] + if [ -n "${WEP_KEY}" ] then - /usr/sbin/iwconfig ${iface} essid "${SSID}" - /usr/sbin/iwconfig ${iface} key "${WEP_KEY}" + ${iwconfig} ${iface} essid "${SSID}" + ${iwconfig} ${iface} key "${WEP_KEY}" fi ;; 2) dialog --title "WEP (Part 3)" --inputbox "Please enter your WEP key in ASCII form. This should be 5 or 13 characters for either 64-bit or 128-bit encryption, repectively" 20 50 2> ${iface}.WEPKEY WEP_KEY="$(cat ${iface}.WEPKEY)" - if [ -n "${WEP_KEY}" -a -x /usr/sbin/iwconfig ] + if [ -n "${WEP_KEY}" ] then - /usr/sbin/iwconfig ${iface} essid "${SSID}" - /usr/sbin/iwconfig ${iface} key "s:${WEP_KEY}" + ${iwconfig} ${iface} essid "${SSID}" + ${iwconfig} ${iface} key "s:${WEP_KEY}" fi ;; esac ;; 2) - /usr/sbin/iwconfig ${iface} essid "${SSID}" - /usr/sbin/iwconfig ${iface} key off + ${iwconfig} ${iface} essid "${SSID}" + ${iwconfig} ${iface} key off ;; esac fi -- cgit v1.2.3-65-gdbad