2 # Filename: grml-network
3 # Purpose: configuration script for network
4 # Authors: Michael Prokop <mika@grml.org>, Marcel Wichern 2006, Klaus Knopper 2002, Niall Walsh + Stefan Lippers-Hollmann 2004-2007
5 # Bug-Reports: see http://grml.org/bugs/
6 # License: This file is licensed under the GPL v2.
7 ################################################################################
8 # Changes have been merged from Kanotix's and Sidux's netcardconfig:
9 # http://kanotix.com/files/debian/pool/main/n/netcardconfig-kanotix/
10 # http://svn.berlios.de/wsvn/fullstory/configure-networkcard/trunk/
11 ################################################################################
13 PATH="/bin:/sbin:/usr/bin:/usr/sbin"
15 export PATH LANGUAGE LANG
17 . /etc/grml/script-functions
27 # This function produces the IWOURLINE for interfaces
30 if [ -n "$NWID" ]; then
31 IWOURLINE="$IWOURLINE wireless-nwid $NWID\n"
34 if [ -n "$MODE" ]; then
35 IWOURLINE="$IWOURLINE wireless-mode $MODE\n"
38 if [ -n "$CHANNEL" ]; then
39 IWOURLINE="$IWOURLINE wireless-channel $CHANNEL\n"
42 if [ -n "$FREQ" ]; then
43 IWOURLINE="$IWOURLINE wireless-freq $FREQ\n"
46 if [ -n "$KEY" ]; then
47 if [ "$PUBKEY" -eq 1 ]; then
48 # Store the key in interfaces in wireless-key
49 IWOURLINE="$IWOURLINE wireless-key $KEY\n"
51 # Store the key in /etc/network/wep.$DV which is root readable only
52 # Use pre-up in interfaces to read and set it
53 echo "$KEY" > "/etc/network/wep.$DV" && chmod 600 "/etc/network/wep.$DV" && IWOURLINE="$IWOURLINE pre-up KEY=\$(cat /etc/network/wep.$DV) && iwconfig $DV key \$KEY\n"
57 for mod in /sys/module/rt2??0/ ; do
58 if [ -d "$mod" ]; then
59 IWPREUPLINE="$IWPREUPLINE pre-up /sbin/ifconfig $DV up\n"
64 if [ -n "$IWCONFIG" ]; then
65 IWPREUPLINE="$IWPREUPLINE iwconfig $IWCONFIG\n"
68 if [ -n "$IWSPY" ]; then
69 IWPREUPLINE="$IWPREUPLINE iwspy $IWSPY\n"
72 if [ -n "$IWPRIV" ]; then
73 IWPREUPLINE="$IWPREUPLINE iwpriv $IWPRIV\n"
76 # execute ESSID last, but make sure that it is written as first option
77 if [ -n "$ESSID" ]; then
78 IWOURLINE="$IWOURLINE wireless-essid $ESSID\n"
81 if [ "$WPAON" -gt 0 ]; then
82 IWOURLINE="$IWOURLINE wpa-ssid $ESSID\n wpa-psk $WPASECRET\n"
85 IWOURLINE="$IWOURLINE $IWPREUPLINE"
86 #echo "DEBUG: for interfaces $IWOURLINE"
89 generate_udev_entry() {
91 mkdir -p /etc/udev/scripts
92 echo "# Auto generated script from netcardconfig on $(date)
93 # Executing this script generates an entry in /etc/udev/rules.d/z25_persistent-net.rules
94 # for you, please check z25_persistent-net.rules for existing entries before
95 # running this script (once more)." > /etc/udev/scripts/netcardconfig
96 for interface in $(ifconfig | awk '/^[a-z]/ &&!/^lo/{ print $1} ') ; do
97 echo -n "INTERFACE=$interface /lib/udev/write_net_rules " >> /etc/udev/scripts/netcardconfig && \
98 if which udevadm >/dev/null 2>&1; then
99 udevadm info -a -p "/sys/class/net/$interface" | awk -F'==' '/address/ {print $2}' >> /etc/udev/scripts/netcardconfig
101 udevinfo -a -p "/sys/class/net/$interface" | awk -F'==' '/address/ {print $2}' >> /etc/udev/scripts/netcardconfig
104 # send errors to /dev/null as well because the sed line inside the /lib/udev/write_net_rules
105 # script outputs a sed warning which might unsettle users
106 chmod +x /etc/udev/scripts/netcardconfig && /etc/udev/scripts/netcardconfig 1>/dev/null 2>&1
109 disable_config_dhcp() {
110 if grep -q CONFIG_DHCP /etc/grml/autoconfig ; then
111 sed -i "s|^CONFIG_DHCP.*|CONFIG_DHCP='no'|" /etc/grml/autoconfig
122 for PART in $DEVICE; do
123 if [ $PARTCOUNT -eq 0 ]; then
126 echo "$PART" | grep -q A::1 && isauto=1
127 echo "$PART" | grep -q F::1 && isfirewire=1
128 echo "$PART" | grep -q W::1 && iswireless=1
129 [ -z "$driver" ] && driver=$(echo "$PART"|awk 'BEGIN {FS="::"} /^D:/{print $2}')
130 [ -z "$mac" ] && mac=$(echo "$PART"|awk 'BEGIN {FS="::"} /^M:/{print $2}')
138 [ $isfirewire -gt 0 ] && MY_DEVICE_NAME="$NET_DEVICE_NAME_FW"
139 [ -z "$MY_DEVICE_NAME" ] && [ $iswireless -gt 0 ] && MY_DEVICE_NAME="$NET_DEVICE_NAME_W"
140 [ -z "$MY_DEVICE_NAME" ] && MY_DEVICE_NAME="$NET_DEVICE_NAME"
141 MY_DEVICE_NAME="$DEVICENAME $MY_DEVICE_NAME $mac $driver"
142 [ $isauto -gt 0 ] && MY_DEVICE_NAME="$MY_DEVICE_NAME $NET_DEVICE_NAME_AUTO"
143 MY_DEVICE_NAME="${MY_DEVICE_NAME// /__}"
147 if ! grep -E "^auto .*$DV" /etc/network/interfaces >/dev/null; then
148 awk '{if(/^auto/){if(done==0){print $0 " '"$DV"'";done=1}else{print}}else{print}}END{if(done==0){print "auto '"$DV"'"}}' "/etc/network/interfaces" > "$TMP"
149 cat "$TMP" > /etc/network/interfaces
154 if grep -e "^auto .*$DV" /etc/network/interfaces >/dev/null; then
155 perl -pi -e 's/^(auto.*)'"$DV"'(.*)$/$1$2/;' /etc/network/interfaces
162 iwlist "$DV" scanning | grep "ESSID\|Quality" | sed -e "s/^.*ESSID:\"\|\"$//g" | tac > "$TMP"
172 [ ! -r /etc/network/interfaces ] && touch /etc/network/interfaces
173 DEVICE=${NETDEVICES[$DV]}
179 WLDEVICECOUNT="$(LANG=C LC_MESSAGEWS=C iwconfig "$DV" 2>/dev/null | wc -l)"
180 if [ $iswireless -gt 0 ] && $DIALOG --yesno "$MESSAGE13" 8 45; then
195 if [ -f /etc/network/interfaces ]; then
196 awk '/iface/{if(/'"$DV"'/){found=1}else{found=0}}
197 /essid/{if(found){for(i=NF;i>=2;i--)essid=$i "~" essid}}
198 /nwid/{if(found){nwid=$NF}}
199 /mode/{if(found){mode=$NF}}
200 /channel/{if(found){channel=$NF}}
201 /freq/{if(found){freq=$NF}}
202 /sens/{if(found){sens=$NF}}
203 /rate/{if(found){rate=$NF}}
204 /rts/{if(found){rts=$NF}}
205 /frag/{if(found){frag=$NF}}
206 /iwconfig/{if(!/KEY/){if(found){iwconfig=$NF}}}
207 /iwspy/{if(found){iwspy=$NF}}
208 /iwpriv/{if(found){iwpriv=$NF}}
209 /wireless[-_]key/{if(found){gsub(/^\W*wireless[-_]key\W*/,"");key=$0}}
211 if (!(length(essid))){essid="~~~"}
212 if (!(length(nwid))){nwid="~~~"}
213 if (!(length(mode))){mode="~~~"}
214 if (!(length(channel))){channel="~~~"}
215 if (!(length(freq))){freq="~~~"}
216 if (!(length(sens))){sens="~~~"}
217 if (!(length(rate))){rate="~~~"}
218 if (!(length(rts))){rts="~~~"}
219 if (!(length(frag))){frag="~~~"}
220 if (!(length(iwconfig))){iwconfig="~~~"}
221 if (!(length(iwspy))){iwspy="~~~"}
222 if (!(length(iwpriv))){iwpriv="~~~"}
223 if (!(length(key))){key="~~~"}
224 print essid" "nwid" "mode" "channel" "freq" "sens" "rate" "rts" "frag" "iwconfig" "iwspy" "iwpriv" "key
225 }' /etc/network/interfaces >"$TMP"
227 read -r ESSID NWID MODE CHANNEL FREQ SENS RATE RTS FRAG IWCONFIG IWSPY IWPRIV KEY<"$TMP"
229 [[ "$ESSID" =~ ^~~~$ ]] && ESSID=""
230 [[ "$NWID" =~ ^~~~$ ]] && NWID=""
231 [[ "$MODE" =~ ^~~~$ ]] && MODE=""
232 [[ "$CHANNEL" =~ ^~~~$ ]] && CHANNEL=""
233 [[ "$FREQ" =~ ^~~~$ ]] && FREQ=""
234 [[ "$SENS" =~ ^~~~$ ]] && SENS=""
235 [[ "$RATE" =~ ^~~~$ ]] && RATE=""
236 [[ "$RTS" =~ ^~~~$ ]] && RTS=""
237 [[ "$FRAG" =~ ^~~~$ ]] && FRAG=""
238 [[ "$IWCONFIG" =~ ^~~~$ ]] && IWCONFIG=""
239 [[ "$IWSPY" =~ ^~~~$ ]] && IWSPY=""
240 [[ "$IWPRIV" =~ ^~~~$ ]] && IWPRIV=""
241 [[ "$KEY" =~ ^~~~$ ]] && KEY=""
243 # shellcheck disable=SC2088
244 ESSID=$(echo $ESSID | tr '~' " " | sed 's/ *$//')
246 if [ -z "$KEY" ]; then
247 KEY=$(cat "/etc/network/wep.$DV" 2>/dev/null)
249 if [ -z "$KEY" ]; then
258 #echo "DEBUG:E:$ESSID N:$NWID M:$MODE C:$CHANNEL F:$FREQ S:$SENS R:$RATE K:$KEY R:$RTS F:$FRAG I:$IWCONFIG I:$IWSPY I:$IWPRIV"
262 # ask to scan or manually set wireless network
263 if $DIALOG --yesno "$MESSAGEWSCAN1" 8 45 ; then
266 while [ $RESCAN -eq 1 ]
269 $DIALOG --extra-button --extra-label "Rescan" --menu "$MESSAGEWSCAN2" 20 70 15 "${WARRAY[@]}" 2>"$TMP"
282 read -r ESSID <"$TMP" ; rm -f "$TMP"
283 [ -z "$MODE" ] && MODE="Managed"
287 $DIALOG --inputbox "$MESSAGEW4 $DEVICENAME $MESSAGEW5" 15 50 "$ESSID" 2>"$TMP" || bailout 1
288 read -r ESSID <"$TMP" ; rm -f "$TMP"
289 [ -z "$ESSID" ] && ESSID="any"
291 $DIALOG --inputbox "$MESSAGEW6 $DEVICENAME $MESSAGEW7" 15 50 "$NWID" 2>"$TMP" || bailout 1
292 read -r NWID <"$TMP" ; rm -f "$TMP"
294 $DIALOG --inputbox "$MESSAGEW8 $DEVICENAME $MESSAGEW9" 15 50 "$MODE" 2>"$TMP" || bailout 1
295 read -r MODE <"$TMP" ; rm -f "$TMP"
296 [ -z "$MODE" ] && MODE="Managed"
298 $DIALOG --inputbox "$MESSAGEW10 $DEVICENAME $MESSAGEW11" 15 50 "$CHANNEL" 2>"$TMP" || bailout 1
299 read -r CHANNEL <"$TMP" ; rm -f "$TMP"
301 if [ -z "$CHANNEL" ]; then
302 $DIALOG --inputbox "$MESSAGEW12 $DEVICENAME $MESSAGEW13" 15 50 "$FREQ" 2>"$TMP" || bailout 1
303 read -r FREQ <"$TMP" ; rm -f "$TMP"
315 ipw2200|ipw2100|ipw3945)
326 if [ -z "$WPA_DEV" ]; then
327 if [ -d "/proc/net/ndiswrapper/$DV" ]; then
329 elif [ -d "/proc/net/hostap/$DV" ]; then
331 elif [ "$WLDEVICECOUNT" -eq 1 ]; then
332 if [ -e /proc/driver/atmel ]; then
340 if [ -n "$WPA_DEV" ]; then
341 if $DIALOG --yesno "$MESSAGEW22" 15 50; then
344 # bssid 00:11:22:33:44:55
345 # priority [0]|Integer
346 # proto [WPA RSN] WPA|RSN
347 # key_mgmt [WPA-PSK WPA-EAP]|NONE|WPA-PSK|WPA-EAP|IEEE8021X
348 # pairwise [CCMP TKIP]|CCMP|TKIP|NONE
349 # group [CCMP TKIP WEP105 WEP40]|CCMP|TKIP|WEP105|WEP40
350 # eapol_flags [3]|1|2
366 if (gsub(/^\W*wpa-psk\W*/,"")){
373 ' /etc/network/interfaces)
374 FIRST_RUN=0 # show the wpasecret input box at least once
375 while ( [ -z "$WPASECRET" ] || [ "$FIRST_RUN" ] ) ; do
376 $DIALOG --inputbox "$MESSAGEW23 $ESSID" 15 50 "$WPASECRET" 2>"$TMP" || bailout 1
377 read -r WPASECRET <"$TMP"
378 if [ -z "$WPASECRET" ] ; then
379 $DIALOG --msgbox "Sorry, empty password not allowed, please retry." 0 0 || bailout 1
398 # No need for a wep key if we are using wpa
399 if [ ! $WPAON -eq 1 ]; then
400 $DIALOG --inputbox "$MESSAGEW14 $DEVICENAME $MESSAGEW15" 15 50 "$KEY" 2>"$TMP" || bailout 1
401 read -r KEY <"$TMP" ; rm -f "$TMP"
403 if [ -n "$KEY" ] && [ "$PUBKEY" -eq 0 ]; then
404 if ! $DIALOG --yesno "$MESSAGEW25 $DEVICENAME $MESSAGEW26" 15 50; then
410 $DIALOG --inputbox "$MESSAGEW16 $DEVICENAME $MESSAGEW17" 15 50 "$IWCONFIG" 2>"$TMP" || bailout 1
411 read -r IWCONFIG <"$TMP" ; rm -f "$TMP"
413 $DIALOG --inputbox "$MESSAGEW18 $DEVICENAME $MESSAGEW19" 15 50 "$IWSPY" 2>"$TMP" || bailout 1
414 read -r IWSPY <"$TMP" ; rm -f "$TMP"
416 $DIALOG --inputbox "$MESSAGEW20 $DEVICENAME $MESSAGEW21" 15 50 "$IWPRIV" 2>"$TMP" || bailout 1
417 read -r IWPRIV <"$TMP" ; rm -f "$TMP"
422 if $DIALOG --yesno "$MESSAGE2" 8 45; then
423 if [ -w /etc/network/interfaces ]; then
425 awk '/iface/{if(/'"$DV"'/){found=1}else{found=0}}
426 /^\W$/{if(blank==0){lastblank=1}else{lastblank=0}{blank=1}}
427 /\w/{blank=0;lastblank=0}
428 {if(!(found+lastblank)){print}}
429 END{print "iface '"$DV"' inet dhcp"}' \
430 /etc/network/interfaces >"$TMP"
431 echo -e "$IWOURLINE" >> "$TMP"
432 #echo -e "\n\n" >> $TMP
433 cat "$TMP" >/etc/network/interfaces
435 # Add an "auto" entry
439 if [ -f /etc/network/interfaces ]; then
440 awk '/iface/{if(/'"$DV"'/){found=1}else{found=0}}
441 /address/{if(found){address=$NF}}
442 /netmask/{if(found){netmask=$NF}}
443 /broadcast/{if(found){broadcast=$NF}}
444 /gateway/{if(found){gateway=$NF}}
445 /dns-nameservers/{if(found){dnsnameservers=$NF}}
446 END{print address" "netmask" "broadcast" "gateway" "dnsnameservers}' /etc/network/interfaces >"$TMP"
447 read -r IP NM BC DG NS <"$TMP"
451 $DIALOG --inputbox "$MESSAGE6 $DV" 10 45 "${IP:-192.168.0.1}" 2>"$TMP" || bailout 1
452 read -r IP <"$TMP" ; rm -f "$TMP"
454 $DIALOG --inputbox "$MESSAGE7 $DV" 10 45 "${NM:-255.255.255.0}" 2>"$TMP" || bailout 1
455 read -r NM <"$TMP" ; rm -f "$TMP"
457 $DIALOG --inputbox "$MESSAGE8 $DV" 10 45 "${BC:-${IP%.*}.255}" 2>"$TMP" || bailout 1
458 read -r BC <"$TMP" ; rm -f "$TMP"
460 $DIALOG --inputbox "$MESSAGE9" 10 45 "${DG:-${IP%.*}.1}" 2>"$TMP"
461 read -r DG <"$TMP" ; rm -f "$TMP"
463 if [ -f "/etc/resolv.conf" ]; then
464 NS="$(awk '/^nameserver/{printf "%s ",$2}' /etc/resolv.conf)"
467 $DIALOG --inputbox "$MESSAGE10" 10 45 "${NS:-$DG}" 2>"$TMP"
468 read -r NS <"$TMP" ; rm -f "$TMP"
470 if [ -w /etc/network/interfaces ]; then
471 awk '/iface/{if(/'"$DV"'/){found=1}else{found=0}}
473 END{print "\niface '"$DV"' inet static\n\taddress '"$IP"'\n\tnetmask '"$NM"'\n\tnetwork '"${IP%.*}.0"'";if("'"$BC"'"!=""){print "\tbroadcast '"$BC"'"};if("'"$DG"'"!=""){print "\tgateway '"$DG"'"};if("'"$NS"'"!=""){print "\tdns-nameservers '"$NS"'"};if("'"$IWOURLINE"'"!=""){print "'"$IWOURLINE"'"};print "\n"}' \
474 /etc/network/interfaces >"$TMP"
476 cat "$TMP" >/etc/network/interfaces
479 # Add an "auto" entry
489 NET_DEVICE_NAME="Network_device"
490 NET_DEVICE_NAME_W="Wireless_device"
491 NET_DEVICE_NAME_FW="Firewire_device"
492 NET_DEVICE_NAME_AUTO="Auto"
493 MESSAGE0="No supported network cards found."
494 MESSAGE1="Please select network device"
495 MESSAGE2="Use DHCP broadcast?"
496 MESSAGE6="Please enter IP Address for"
497 MESSAGE7="Please enter Network Mask for"
498 MESSAGE8="Please enter Broadcast Address for"
499 MESSAGE9="Please enter Default Gateway"
500 MESSAGE10="Please enter Nameserver(s)"
501 MESSAGE13="Setup wireless options?"
502 MESSAGE14="Failed to bring up the interface, would you like to reconfigure it?"
503 MESSAGE15="Interface enabled, do you want it auto enabled at boot?"
504 MESSAGEW4="Enter the ESSID for"
505 MESSAGEW5="\n\n\n(empty for 'any', not recommended !)\n"
506 MESSAGEW6="Enter the NWID (cell identifier)\nfor"
507 MESSAGEW7=", if needed\n\n\n"
508 MESSAGEW8="Enter the mode for"
509 MESSAGEW9="\n\n(Managed(=default), Ad-Hoc, Master,\nRepeater, Secondary, auto)\n"
510 MESSAGEW10="Enter channel number for"
511 MESSAGEW11="\n\n(0 bis 16, empty for auto or if you want to\n enter the frequency next)\n"
512 MESSAGEW12="Enter the frequency for"
513 MESSAGEW13="\n\n(e.g 2.412G, empty for auto)"
514 MESSAGEW14="Enter the encryption key\nfor"
515 MESSAGEW15="\n\n(empty for cleartext, not recommended !!)"
516 MESSAGEW16="Enter additional parameters for\n'iwconfig"
517 MESSAGEW17="' if needed, e.g.\n\n\nsens -80 rts 512 frag 512 rate 5.5M"
518 MESSAGEW18="Enter additional parameters for\n'iwspy"
519 MESSAGEW19="' if needed\n\n\n"
520 MESSAGEW20="Enter additional parameters for\n'iwpriv"
521 MESSAGEW21="' if needed\n\n\n"
522 MESSAGEW22="Enable WPA support?"
523 MESSAGEW23="Enter the WPA passphrase (passphrase must be 8..63 characters) for"
524 MESSAGEW25="Would you like to store your wep key in it's own private file ("
525 MESSAGEW26=")? If you say no, your wep key will be stored in /etc/network/interfaces and will be readable by any account on your system. You may want to 'chmod 600 /etc/network/interfaces' if you answer no to this question"
526 MESSAGEWSCAN1="Scan for available wireless networks?"
527 MESSAGEWSCAN2="Please choose a wireless network from below:"
530 if [ -r /proc/net/dev ] ; then
531 LAN=$(tail -n +3 /proc/net/dev | awk -F: '{print $1}'| sed "s/\s*//" | grep -v -e ^lo -e ^vmnet | sort)
536 if [ -z "${WLAN[*]}" ] ; then
537 WLAN_OLD=( $(tail -n +3 /proc/net/wireless 2>/dev/null|awk -F: '{print $1}') )
538 # /proc/net/wireless does not work e.g. with iwl3945 on kernel 2.6.33 anymore
539 WLAN_NEW=( $(for i in /sys/class/net/* ; do ( [ -d "$i/wireless" ] || [ -d "$i/phy80211" ] ) && basename "$i" ; done) )
542 iwconfig $DEV 2>/dev/null 1>&2 && WLAN_IWCONFIG+=($DEV)
544 WLAN=( $(echo "${WLAN_OLD[@]}" "${WLAN_NEW[@]}" "${WLAN_IWCONFIG[@]}" | tr ' ' '\n' | sort -u) )
547 unset LAN_DEVICES WLAN_DEVICES FIREWIRE_DEVICES NETDEVICES WLAN_IWCONFIG
549 while read -r dev mac; do
550 #echo "Making NETDEVICES $NETDEVICESCOUNT $dev"
551 iswlan=$(echo "$dev" "${WLAN[@]}"|tr ' ' '\n'|sort|uniq -d)
553 grep auto /etc/network/interfaces | grep -q "$dev" && isauto="1"
554 driver=$(ethtool -i "$dev" 2>/dev/null|awk '/^driver:/{print $2}')
555 if [ "$driver" ]; then
556 if [ "$iswlan" ]; then
557 NETDEVICES[$NETDEVICESCOUNT]="$dev A::$isauto M::$mac D::$driver W::1 F::0"
559 NETDEVICES[$NETDEVICESCOUNT]="$dev A::$isauto M::$mac D::$driver W::0 F::0"
562 if [ "$iswlan" ]; then
563 NETDEVICES[$NETDEVICESCOUNT]="$dev A::$isauto M::$mac W::1 F::0"
565 NETDEVICES[$NETDEVICESCOUNT]="$dev A::$isauto M::$mac W::0 F::0"
568 #echo "Made to ${NETDEVICES[$NETDEVICESCOUNT]}"
569 ((NETDEVICESCOUNT++))
570 done < <(ip link show | awk ' !/^\s/{sub(/:/,"",$2);IFACE=$2} /link.ether/{if (IFACE !~/^vmnet/) print IFACE" "$2}')
572 if [ "$(ethtool -i $dev 2>/dev/null|awk '/^bus-info:/{print $2}')" == "ieee1394" ]; then
574 grep auto /etc/network/interfaces | grep -q $dev && isauto="1"
575 NETDEVICES[$NETDEVICESCOUNT]="$dev A::$isauto D::$(ethtool -i $dev 2>/dev/null|awk '/^driver:/{print $2}') W::0 F::1"
576 ((NETDEVICESCOUNT++))
580 #NETDEVICES="$(cat /proc/net/dev | awk -F: '/eth.:|lan.:|tr.:|wlan.:|ath.:|ra.:/{print $1}')"
582 if [ -z "${NETDEVICES[*]}" ]; then
583 $DIALOG --msgbox "$MESSAGE0" 15 45
587 count="$NETDEVICESCOUNT"
589 if [ "$count" -gt 1 ]; then
592 while [ $mycount -lt $count ]; do
593 DEVICE=${NETDEVICES[$mycount]}
594 #echo "$mycount is $DEVICE"
596 #echo "name: $DEVICENAME auto: $isauto fw: $isfirewire mac: $mac driver: $driver"
598 DEVICELIST=( "${DEVICELIST[@]}" "$mycount" "$MY_DEVICE_NAME" )
605 EXITMENU=( $EXITKEY Exit )
607 # main program loop until they bailout
609 # first get the device
610 if [ "$count" -gt 1 ]; then
612 $DIALOG --menu "$MESSAGE1" 18 60 12 "${DEVICELIST[@]}" "${EXITMENU[@]}" 2>"$TMP" || bailout
613 read -r DV <"$TMP" ; rm -f "$TMP"
614 [ "$DV" = "$EXITKEY" ] && bailout
618 # they have asked to stop configuring the interface so exit
619 [ -z "$IFACEDONE" ] || bailout
623 while [ -n "$DV" ] && [ -z "$IFACEDONE" ]; do
626 $DIALOG --yesno "$MESSAGE14" 15 50 || IFACEDONE="DONE"
628 if $DIALOG --yesno "$MESSAGE15" 12 50 ; then
630 # get persistent interface names across reboots
632 # make sure we don't run the dhcp stuff when using /etc/network/interfaces
642 ## END OF FILE #################################################################