2 # Filename: grml-network
3 # Purpose: configuration script for network
4 # Authors: Klaus Knopper 2002, Niall Walsh + Stefan Lippers-Hollmann 2005, Michael Prokop <mika@grml.org>, Marcel Wichern <marcel@grml.org>
5 # Bug-Reports: see http://grml.org/bugs/
6 # License: This file is licensed under the GPL v2.
7 # Latest change: Mit Okt 04 11:52:26 CEST 2006 [mika]
8 ################################################################################
9 # Changes have been merged from Kanotix's netcardconfig taken from
10 # http://kanotix.com/files/debian/pool/main/n/netcardconfig-kanotix/
11 ################################################################################
13 PATH="/bin:/sbin:/usr/bin:/usr/sbin"
17 if [ $UID != 0 ]; then
18 echo Error: become root before starting $0 >&2
31 # This function produces the IWOURLINE for interfaces
34 if [ -n "$NWID" ]; then
35 IWOURLINE="$IWOURLINE wireless-nwid $NWID\n"
38 if [ -n "$MODE" ]; then
39 IWOURLINE="$IWOURLINE wireless-mode $MODE\n"
42 if [ -n "$CHANNEL" ]; then
43 IWOURLINE="$IWOURLINE wireless-channel $CHANNEL\n"
46 if [ -n "$FREQ" ]; then
47 IWOURLINE="$IWOURLINE wireless-freq $FREQ\n"
50 if [ -n "$KEY" ]; then
51 if [ "$PUBKEY" -eq 1 ]; then
52 # Store the key in interfaces in wireless-key
53 IWOURLINE="$IWOURLINE wireless-key $KEY\n"
55 # Store the key in /etc/network/wep.$DV which is root readable only
56 # Use pre-up in interfaces to read and set it
57 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"
61 [ -d /sys/module/rt2??0/ ] && IWPREUPLINE="$IWPREUPLINE pre-up /sbin/ifconfig $DV up\n"
63 if [ -n "$IWCONFIG" ]; then
64 IWPREUPLINE="$IWPREUPLINE iwconfig $IWCONFIG\n"
67 if [ -n "$IWSPY" ]; then
68 IWPREUPLINE="$IWPREUPLINE iwspy $IWSPY\n"
71 if [ -n "$IWPRIV" ]; then
72 IWPREUPLINE="$IWPREUPLINE iwpriv $IWPRIV\n"
75 # execute ESSID last, but make sure that it is written as first option
76 if [ -n "$ESSID" ]; then
77 IWOURLINE="$IWOURLINE wireless-essid $ESSID\n"
80 if [ $WPAON -gt 0 ]; then
81 # Using wpa requires a wpa_supplicant entry
82 IWPREUPLINE="${IWPREUPLINE}pre-up wpa_supplicant -D$WPA_DEV -i$WLDEVICE -c/etc/wpa_supplicant.conf -B\n"
83 touch /etc/wpa_supplicant.conf
84 awk '/^network={/{if(found){found=0}else{found=1;hold=$0}}/ssid={/{if(/ssid='"$ESSID"'/){found=1}else{found=0;print hold}}{if(!found){print}}' /etc/wpa_supplicant.conf >> "$TMP"
85 wpa_passphrase "$ESSID" "$WPASECRET" 2>/dev/null >> "$TMP"
86 mv -f /etc/wpa_supplicant.conf /etc/wpa_supplicant.conf.$(date +%Y%m%d_%H%M)
87 if ! grep -q "For more information take a look at" /etc/wpa_supplicant.conf ; then
89 # /etc/wpa_supplicant.conf
90 # For more information take a look at /usr/share/doc/wpasupplicant/
94 # bssid 00:11:22:33:44:55
95 # priority [0]|Integer
96 # proto [WPA RSN] WPA|RSN
97 # key_mgmt [WPA-PSK WPA-EAP]|NONE|WPA-PSK|WPA-EAP|IEEE8021X
98 # pairwise [CCMP TKIP]|CCMP|TKIP|NONE
99 # group [CCMP TKIP WEP105 WEP40]|CCMP|TKIP|WEP105|WEP40
100 # eapol_flags [3]|1|2
104 [ -n "$APSCAN" ] && echo "$APSCAN" >> "$WPATMP"
105 cat "$WPATMP" "$TMP" > /etc/wpa_supplicant.conf
106 rm -f $WPATMP 2>/dev/null
107 IWDOWNLINE="${IWDOWNLINE}down killall wpa_supplicant\n"
110 IWOURLINE="$IWOURLINE $IWPREUPLINE $IWDOWNLINE"
111 #echo "DEBUG: for interfaces $IWOURLINE"
121 for PART in $DEVICE; do
122 if [ $PARTCOUNT -eq 0 ]; then
125 echo $PART | grep -q A::1 && isauto=1
126 echo $PART | grep -q F::1 && isfirewire=1
127 echo $PART | grep -q W::1 && iswireless=1
128 [ -z "$driver" ] && driver=$(echo $PART|awk 'BEGIN {FS="::"} /^D:/{print $2}')
129 [ -z "$mac" ] && mac=$(echo $PART|awk 'BEGIN {FS="::"} /^M:/{print $2}')
137 [ $isfirewire -gt 0 ] && MY_DEVICE_NAME="$NET_DEVICE_NAME_FW"
138 [ -z "$MY_DEVICE_NAME" -a $iswireless -gt 0 ] && MY_DEVICE_NAME="$NET_DEVICE_NAME_W"
139 [ -z "$MY_DEVICE_NAME" ] && MY_DEVICE_NAME="$NET_DEVICE_NAME"
140 MY_DEVICE_NAME="$DEVICENAME $MY_DEVICE_NAME $mac $driver"
141 [ $isauto -gt 0 ] && MY_DEVICE_NAME="$MY_DEVICE_NAME $NET_DEVICE_NAME_AUTO"
142 MY_DEVICE_NAME=$(echo $MY_DEVICE_NAME | sed 's/\ /__/g')
146 if ! egrep -e "^auto[ ]+.*$DV" /etc/network/interfaces >/dev/null; then
147 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"
148 cat "$TMP" > /etc/network/interfaces
153 if egrep -e "^auto[ ]+.*$DV" /etc/network/interfaces >/dev/null; then
154 perl -pi -e 's/^(auto.*)'$DV'(.*)$/$1$2/;' /etc/network/interfaces
159 [ ! -r /etc/network/interfaces ] && touch /etc/network/interfaces
160 DEVICE=${NETDEVICES[$DV]}
164 WLDEVICE="$(LANG=C LC_MESSAGEWS=C iwconfig $DV 2>/dev/null | awk '/802\.11|READY|ESSID/{print $1}')"
165 WLDEVICECOUNT="$(LANG=C LC_MESSAGEWS=C iwconfig $DV 2>/dev/null | wc -l)"
166 if [ $iswireless -gt 0 ] && $DIALOG --yesno "$MESSAGE13" 8 45; then
181 if [ -f /etc/network/interfaces ]; then
182 awk '/iface/{if(/'"$DV"'/){found=1}else{found=0}}
183 /essid/{if(found){for(i=NF;i>=2;i--)essid=$i "~" essid}}
184 /nwid/{if(found){nwid=$NF}}
185 /mode/{if(found){mode=$NF}}
186 /channel/{if(found){channel=$NF}}
187 /freq/{if(found){freq=$NF}}
188 /sens/{if(found){sens=$NF}}
189 /rate/{if(found){rate=$NF}}
190 /rts/{if(found){rts=$NF}}
191 /frag/{if(found){frag=$NF}}
192 /iwconfig/{if(!/KEY/){if(found){iwconfig=$NF}}}
193 /iwspy/{if(found){iwspy=$NF}}
194 /iwpriv/{if(found){iwpriv=$NF}}
195 /wireless[-_]key/{if(found){gsub(/^\W*wireless[-_]key\W*/,"");key=$0}}
197 if (!(length(essid))){essid="~~~"}
198 if (!(length(nwid))){nwid="~~~"}
199 if (!(length(mode))){mode="~~~"}
200 if (!(length(channel))){channel="~~~"}
201 if (!(length(freq))){freq="~~~"}
202 if (!(length(sens))){sens="~~~"}
203 if (!(length(rate))){rate="~~~"}
204 if (!(length(rts))){rts="~~~"}
205 if (!(length(frag))){frag="~~~"}
206 if (!(length(iwconfig))){iwconfig="~~~"}
207 if (!(length(iwspy))){iwspy="~~~"}
208 if (!(length(iwpriv))){iwpriv="~~~"}
209 if (!(length(key))){key="~~~"}
210 print essid" "nwid" "mode" "channel" "freq" "sens" "rate" "rts" "frag" "iwconfig" "iwspy" "iwpriv" "key
211 }' /etc/network/interfaces >"$TMP"
213 read ESSID NWID MODE CHANNEL FREQ SENS RATE RTS FRAG IWCONFIG IWSPY IWPRIV KEY<"$TMP"
215 if [ "$ESSID" = "~~~" ]; then ESSID=""; fi
216 if [ "$NWID" = "~~~" ]; then NWID=""; fi
217 if [ "$MODE" = "~~~" ]; then MODE=""; fi
218 if [ "$CHANNEL" = "~~~" ]; then CHANNEL=""; fi
219 if [ "$FREQ" = "~~~" ]; then FREQ=""; fi
220 if [ "$SENS" = "~~~" ]; then SENS=""; fi
221 if [ "$RATE" = "~~~" ]; then RATE=""; fi
222 if [ "$RTS" = "~~~" ]; then RTS=""; fi
223 if [ "$FRAG" = "~~~" ]; then FRAG=""; fi
224 if [ "$IWCONFIG" = "~~~" ]; then IWCONFIG=""; fi
225 if [ "$IWSPY" = "~~~" ]; then IWSPY=""; fi
226 if [ "$IWPRIV" = "~~~" ]; then IWPRIV=""; fi
227 if [ "$KEY" = "~~~" ]; then KEY=""; fi
229 ESSID=$(echo $ESSID | tr "~" " " | sed 's/ *$//')
231 if [ -z "$KEY" ]; then
232 KEY=$(cat /etc/network/wep.$DV 2>/dev/null)
234 if [ -z "$KEY" ]; then
243 #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"
247 $DIALOG --inputbox "$MESSAGEW4 $DEVICENAME $MESSAGEW5" 15 50 "$ESSID" 2>"$TMP" || bailout 1
248 read ESSID <"$TMP" ; rm -f "$TMP"
249 [ -z "$ESSID" ] && ESSID="any"
251 $DIALOG --inputbox "$MESSAGEW6 $DEVICENAME $MESSAGEW7" 15 50 "$NWID" 2>"$TMP" || bailout 1
252 read NWID <"$TMP" ; rm -f "$TMP"
254 $DIALOG --inputbox "$MESSAGEW8 $DEVICENAME $MESSAGEW9" 15 50 "$MODE" 2>"$TMP" || bailout 1
255 read MODE <"$TMP" ; rm -f "$TMP"
256 [ -z "$MODE" ] && MODE="Managed"
258 $DIALOG --inputbox "$MESSAGEW10 $DEVICENAME $MESSAGEW11" 15 50 "$CHANNEL" 2>"$TMP" || bailout 1
259 read CHANNEL <"$TMP" ; rm -f "$TMP"
261 if [ -z "$CHANNEL" ]; then
262 $DIALOG --inputbox "$MESSAGEW12 $DEVICENAME $MESSAGEW13" 15 50 "$FREQ" 2>"$TMP" || bailout 1
263 read FREQ <"$TMP" ; rm -f "$TMP"
281 if [ -z "$WPA_DEV" ]; then
282 if [ -d /proc/net/ndiswrapper/$DV ]; then
284 elif [ -d /proc/net/hostap/$DV ]; then
286 elif [ $WLDEVICECOUNT -eq 1 ]; then
287 if [ -e /proc/driver/atmel ]; then
295 if [ -n "$WPA_DEV" ]; then
296 if $DIALOG --yesno "$MESSAGEW22" 15 50; then
299 # bssid 00:11:22:33:44:55
300 # priority [0]|Integer
301 # proto [WPA RSN] WPA|RSN
302 # key_mgmt [WPA-PSK WPA-EAP]|NONE|WPA-PSK|WPA-EAP|IEEE8021X
303 # pairwise [CCMP TKIP]|CCMP|TKIP|NONE
304 # group [CCMP TKIP WEP105 WEP40]|CCMP|TKIP|WEP105|WEP40
305 # eapol_flags [3]|1|2
307 if ! $DIALOG --yesno "Is SSID broadcast enabled?" 15 50; then
312 WPASECRET=$(awk '/network/{if(found){found=0}else{found=1}}/ssid/{if(/ssid="'"$ESSID"'"/){found=1}else{found=0}}/#scan_ssid=1/#psk=/{if(found){gsub(/^\W*#psk="/,"");gsub(/"\W*$/,"");print}}' /etc/wpa_supplicant.conf)
314 $DIALOG --inputbox "$MESSAGEW23 $ESSID" 15 50 "$WPASECRET" 2>"$TMP" || bailout 1
315 WPASECRET=$(sed -e 's/\\/\\/g' "$TMP") && rm -r "$TMP"
329 # No need for a wep key if we are using wpa
330 if [ ! $WPAON -eq 1 ]; then
331 $DIALOG --inputbox "$MESSAGEW14 $DEVICENAME $MESSAGEW15" 15 50 "$KEY" 2>"$TMP" || bailout 1
332 read KEY <"$TMP" ; rm -f "$TMP"
334 if [ -n "$KEY" -a "$PUBKEY" -eq 0 ]; then
335 if ! $DIALOG --yesno "$MESSAGEW25 $DEVICENAME $MESSAGEW26" 15 50; then
341 $DIALOG --inputbox "$MESSAGEW16 $DEVICENAME $MESSAGEW17" 15 50 "$IWCONFIG" 2>"$TMP" || bailout 1
342 read IWCONFIG <"$TMP" ; rm -f "$TMP"
344 $DIALOG --inputbox "$MESSAGEW18 $DEVICENAME $MESSAGEW19" 15 50 "$IWSPY" 2>"$TMP" || bailout 1
345 read IWSPY <"$TMP" ; rm -f "$TMP"
347 $DIALOG --inputbox "$MESSAGEW20 $DEVICENAME $MESSAGEW21" 15 50 "$IWPRIV" 2>"$TMP" || bailout 1
348 read IWPRIV <"$TMP" ; rm -f "$TMP"
353 if $DIALOG --yesno "$MESSAGE2" 8 45; then
354 if [ -w /etc/network/interfaces ]; then
356 awk '/iface/{if(/'"$DV"'/){found=1}else{found=0}}
357 /^\W$/{if(blank==0){lastblank=1}else{lastblank=0}{blank=1}}
358 /\w/{blank=0;lastblank=0}
359 {if(!(found+lastblank)){print}}
360 END{print "iface '"$DV"' inet dhcp"}' \
361 /etc/network/interfaces >"$TMP"
362 echo -e "$IWOURLINE" >> $TMP
363 #echo -e "\n\n" >> $TMP
364 cat "$TMP" >/etc/network/interfaces
366 # Add an "auto" entry
370 if [ -f /etc/network/interfaces ]; then
371 awk '/iface/{if(/'"$DV"'/){found=1}else{found=0}}
372 /address/{if(found){address=$NF}}
373 /netmask/{if(found){netmask=$NF}}
374 /broadcast/{if(found){broadcast=$NF}}
375 /gateway/{if(found){gateway=$NF}}
376 END{print address" "netmask" "broadcast" "gateway}' /etc/network/interfaces >"$TMP"
377 read IP NM BC DG <"$TMP"
381 $DIALOG --inputbox "$MESSAGE6 $DV" 10 45 "${IP:-192.168.0.1}" 2>"$TMP" || bailout 1
382 read IP <"$TMP" ; rm -f "$TMP"
384 $DIALOG --inputbox "$MESSAGE7 $DV" 10 45 "${NM:-255.255.255.0}" 2>"$TMP" || bailout 1
385 read NM <"$TMP" ; rm -f "$TMP"
387 $DIALOG --inputbox "$MESSAGE8 $DV" 10 45 "${BC:-${IP%.*}.255}" 2>"$TMP" || bailout 1
388 read BC <"$TMP" ; rm -f "$TMP"
390 $DIALOG --inputbox "$MESSAGE9" 10 45 "${DG:-${IP%.*}.254}" 2>"$TMP"
391 read DG <"$TMP" ; rm -f "$TMP"
393 if [ -f "/etc/resolv.conf" ]; then
394 NS="$(awk '/^nameserver/{printf "%s ",$2}' /etc/resolv.conf)"
397 $DIALOG --inputbox "$MESSAGE10" 10 45 "${NS:-${IP%.*}.254}" 2>"$TMP"
398 read NS <"$TMP" ; rm -f "$TMP"
400 if [ -w /etc/network/interfaces ]; then
401 awk '/iface/{if(/'"$DV"'/){found=1}else{found=0}}
403 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("'"$IWOURLINE"'"!=""){print "'"$IWOURLINE"'"};print "\n"}' \
404 /etc/network/interfaces >"$TMP"
406 cat "$TMP" >/etc/network/interfaces
409 # Add an "auto" entry
413 if [ -n "$NS" ]; then
417 if [ -z "$more" ]; then
420 echo "nameserver $i" >/etc/resolv.conf
423 echo "nameserver $i" >>/etc/resolv.conf
432 # export XDIALOG_HIGH_DIALOG_COMPAT=1
433 # [ -n "$DISPLAY" ] && [ -x /usr/bin/Xdialog ] && DIALOG="Xdialog"
436 [ -r /etc/default/locale ] && . /etc/default/locale
438 # Default all strings to English
439 NET_DEVICE_NAME="Network_device"
440 NET_DEVICE_NAME_W="Wireless_device"
441 NET_DEVICE_NAME_FW="Firewire_device"
442 NET_DEVICE_NAME_AUTO="Auto"
443 MESSAGE0="No supported network cards found."
444 MESSAGE1="Please select network device"
445 MESSAGE2="Use DHCP broadcast?"
446 MESSAGE3="Sending DHCP broadcast from device"
448 MESSAGE5="Hit return to exit."
449 MESSAGE6="Please enter IP Address for "
450 MESSAGE7="Please enter Network Mask for "
451 MESSAGE8="Please enter Broadcast Address for "
452 MESSAGE9="Please enter Default Gateway"
453 MESSAGE10="Please enter Nameserver(s)"
454 MESSAGE11="Setting Nameserver in /etc/resolv.conf to"
455 MESSAGE12="Adding Nameserver to /etc/resolv.conf:"
456 MESSAGE13="Setup wireless options?"
457 MESSAGE14="Failed to bring up the interface, would you like to reconfigure it?"
458 MESSAGE15="Interface enabled, do you want it auto enabled at boot?"
459 MESSAGEW0="No wireless network card found."
460 MESSAGEW1="Configuration of wireless parameters for"
461 MESSAGEW3="Please configure IP parameters of the interface first"
462 MESSAGEW4="Enter the ESSID for"
463 MESSAGEW5="\n\n\n(empty for 'any', not recommended !)\n"
464 MESSAGEW6="Enter the NWID (cell identifier)\nfor"
465 MESSAGEW7=", if needed\n\n\n"
466 MESSAGEW8="Enter the mode for"
467 MESSAGEW9="\n\n(Managed(=default), Ad-Hoc, Master,\nRepeater, Secondary, auto)\n"
468 MESSAGEW10="Enter channel number for"
469 MESSAGEW11="\n\n(0 bis 16, empty for auto or if you want to\n enter the frequency next)\n"
470 MESSAGEW12="Enter the frequency for"
471 MESSAGEW13="\n\n(e.g 2.412G, empty for auto)"
472 MESSAGEW14="Enter the encryption key\nfor"
473 MESSAGEW15="\n\n(empty for cleartext, not recommended !!)"
474 MESSAGEW16="Enter additional parameters for\n'iwconfig"
475 MESSAGEW17="' if needed, e.g.\n\n\nsens -80 rts 512 frag 512 rate 5.5M"
476 MESSAGEW18="Enter additional parameters for\n'iwspy"
477 MESSAGEW19="' if needed\n\n\n"
478 MESSAGEW20="Enter additional parameters for\n'iwpriv"
479 MESSAGEW21="' if needed\n\n\n"
480 MESSAGEW22="Enable WPA support?"
481 MESSAGEW23="Enter the WPA passphrase (passphrase must be 8..63 characters) for"
482 MESSAGEW25="Would you like to store your wep key in it's own private file ("
483 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"
484 MESSAGEW27="Is SSID broadcast enabled?"
488 NET_DEVICE_NAME="Netzwerkkarte"
489 MESSAGE0="Keine unterstützten Netzwerkkarte(n) gefunden."
490 MESSAGE1="Bitte Netzwerkkarte auswählen"
491 MESSAGE2="DHCP Broadcast zur Konfiguration benutzen? (Nein=manuell)"
492 MESSAGE3="Sende DHCP Broadcast von Netzwerkkarte"
493 MESSAGE4="Fehlgeschlagen."
494 MESSAGE5="Eingabetaste zum Beenden."
495 MESSAGE6="Bitte geben Sie die IP-Adresse ein für "
496 MESSAGE7="Bitte geben Sie die Netzwerk-Maske ein für "
497 MESSAGE8="Bitte geben Sie die Broadcast-Adresse ein für "
498 MESSAGE9="Bitte geben Sie das Default-Gateway ein"
499 MESSAGE10="Bitte geben Sie den/die Nameserver ein"
500 MESSAGE11="Setze Nameserver in /etc/resolv.conf auf "
501 MESSAGE12="Füge Nameserver in /etc/resolv.conf hinzu:"
502 MESSAGE13="WLAN-Einstellungen konfigurieren?"
503 MESSAGE14="Fehler beim Aktivieren des Interface, wollen Sie es neu konfigurieren?"
504 MESSAGE15="Interface aktiviert, beim Systemstart automatisch aktivieren?"
505 MESSAGEW0="Keine Wireless-Netzwerkkarte gefunden."
506 MESSAGEW1="Konfiguration der Wireless-Parameter von"
507 MESSAGEW2="Bitte Wireless-Netzwerkkarte auswählen"
508 MESSAGEW3="Bitte konfigurieren Sie vorher die IP-Parameter der Karte !"
509 MESSAGEW4="Geben Sie die ESSID für"
510 MESSAGEW5="ein\n\n\n(leer für 'any', nicht zu empfehlen !!)\n"
511 MESSAGEW6="Geben Sie ggf. die NWID (Cell Identifier)\nfür"
512 MESSAGEW7="ein, falls es eine gibt\n\n\n"
513 MESSAGEW8="Geben Sie den Modus für"
514 MESSAGEW9="ein\n\n(Managed(=default), Ad-Hoc, Master,\nRepeater, Secondary, auto)\n"
515 MESSAGEW10="Geben Sie den Kanal für"
516 MESSAGEW11="ein\n\n(0 bis 16, leer für auto oder Frequenz-\neingabe im nächsten Fenster)\n"
517 MESSAGEW12="Geben Sie die Frequenz für"
518 MESSAGEW13="ein\n\n(z.B. 2.412G, leer für auto)"
519 MESSAGEW14="Geben Sie den Verschlüsselungs-Key\nfür"
520 MESSAGEW15="ein\n\n(leer für Klartext, nicht zu empfehlen !!)"
521 MESSAGEW16="Geben Sie ggf. zusätzliche Parameter für\n'iwconfig"
522 MESSAGEW17="' ein, z.B.\n\n\nsens -80 rts 512 frag 512 rate 5.5M"
523 MESSAGEW18="Geben Sie ggf. zusätzliche Parameter für\n'iwspy"
524 MESSAGEW19="' ein\n\n\n"
525 MESSAGEW20="Geben Sie ggf. zusätzliche Parameter für\n'iwpriv"
526 MESSAGEW21="' ein\n\n\n"
527 MESSAGEW22="WPA-Unterstützung aktivieren?"
528 MESSAGEW23="WPA-Passwort eingeben für"
529 MESSAGEW25="WEP-Schlüssel in privater Datei abspeichern ("
530 MESSAGEW26="? Wenn Sie hier Nein sagen, wird der WEP-Schlüssel in /etc/network/interfaces abgespeichert und kann von allen Accounts auf dem System gelesen werden. Wenn Sie mit Nein antworten, sollten Sie vielleicht 'chmod 600 /etc/network/interfaces' ausführen."
531 MESSAGEW27="Ist SSID Broadcast aktiviert?"
534 NET_DEVICE_NAME="Dispositivo_de_la_red"
535 MESSAGE0="Se han encontrado tarjetas de red no soportadas."
536 MESSAGE1="Por favor, seleccione el dispositivo fisico de red"
537 MESSAGE2="¿Utilizar broadcast DHCP?"
538 MESSAGE3="Enviando broadcast DHCP desde el dispositivo"
540 MESSAGE5="Pulse enter para salir."
541 MESSAGE6="Por favor, inserte la dirección IP para "
542 MESSAGE7="Por favor, inserte la máscara de red para "
543 MESSAGE8="Por favor, inserte la dirección de Broadcast para "
544 MESSAGE9="Por favor, inserte la puerta de enlace por defecto"
545 MESSAGE10="Por favor, inserte los servidores DNS"
546 MESSAGE11="Poniendo los servidores de nombres de /etc/resolv.conf a "
547 MESSAGE12="Adicionando servidor DNS a /etc/resolv.conf:"
548 MESSAGEW0="No se ha encontrado una tarjeta inalámbrica."
549 MESSAGEW1="Configuración de los parámetros inalámbricos para"
550 MESSAGEW2="Por favor, seleccione un dispositivo de red inalámbrico"
551 MESSAGEW3="Por favor, configure primero los parámetros de la IP para la interfaz"
552 MESSAGEW4="Teclee el ESSID para"
553 MESSAGEW5="\n\n\n(vacío para 'cualquiera', ¡no recomendado!)\n"
554 MESSAGEW6="Teclee el NWID (identificador de celda)\npara"
555 MESSAGEW7=", si es necesario\n\n\n"
556 MESSAGEW8="Teclee el modo para"
557 MESSAGEW9="\n\n(Managed(=por_defecto), Ad-Hoc, Master,\nRepeater, Secondary, auto)\n"
558 MESSAGEW10="Teclee el número del canal para"
559 MESSAGEW11="\n\n(0 bis 16, vacío para auto o si lo prefiere\n teclee la frecuencia seguidamente)\n"
560 MESSAGEW12="Teclee la frecuencia para"
561 MESSAGEW13="\n\n(ej. 2.412G, vacío para auto)"
562 MESSAGEW14="Teclee la clave de encriptación\npara"
563 MESSAGEW15="\n\n(vacío para texto plano, ¡¡no recomendado!!)"
564 MESSAGEW16="Teclee los parámetros adicionales para\n'iwconfig"
565 MESSAGEW17="' Si es necesario, ej.\n\n\nsens -80 rts 512 frag 512 rate 5.5M"
566 MESSAGEW18="Teclee los parámetros adicionales para\n'iwspy"
567 MESSAGEW19="' si es necesario\n\n\n"
568 MESSAGEW20="Teclee los parámetros adicionales para\n'iwpriv"
569 MESSAGEW21="' si es necesario\n\n\n"
572 NET_DEVICE_NAME="Periferica_di_rete"
573 NET_DEVICE_NAME_W="Periferica_Wireless"
574 NET_DEVICE_NAME_FW="Periferica_Firewire"
575 NET_DEVICE_NAME_AUTO="Automatico"
576 MESSAGE0="Non ho trovato schede di rete supportate."
577 MESSAGE1="Per favore seleziona la periferica di rete"
578 MESSAGE2="Devo utilizzare il broadcast DHCP?"
579 MESSAGE3="Sto inviando il broadcast DHCP dalla periferica"
581 MESSAGE5="Premi invio per uscire."
582 MESSAGE6="Inserisci l'indirizzo IP per "
583 MESSAGE7="Inserisci la maschera di rete per "
584 MESSAGE8="Inserisci l'indirizzo di broadcast per "
585 MESSAGE9="Inserisci il Gateway di default"
586 MESSAGE10="Inserisci i Nameserver"
587 MESSAGE11="Sto settando i Nameserver in /etc/resolv.conf a"
588 MESSAGE12="Aggiungo i Nameserver in /etc/resolv.conf:"
589 MESSAGE13="Configuro le opzioni del wireless?"
590 MESSAGE14="Non riesco ad attivare l'interfaccia, vuoi riconfigurarla?"
591 MESSAGE15="Interfaccia attiva, vuoi abilitarla automaticamente all'avvio?"
592 MESSAGEW0="Nessuna scheda di rete wireless trovata."
593 MESSAGEW1="Configurazione dei parametri wireless per"
594 MESSAGEW3="Configura i parametri IP dell'interfaccia per prima cosa!"
595 MESSAGEW4="Inserisci l'ESSID per"
596 MESSAGEW5="\n\n\n(vuoto per 'tutti', non raccomandato!)\n"
597 MESSAGEW6="Inserisci il NWID (cell identifier)\nper"
598 MESSAGEW7=", se necessario\n\n\n"
599 MESSAGEW8="Inserisci la modalità per"
600 MESSAGEW9="\n\n(Managed(=default), Ad-Hoc, Master,\nRepeater, Secondary, auto)\n"
601 MESSAGEW10="Inserisci il numero di canale per"
602 MESSAGEW11="\n\n(da 0 a 16, vuoto per automatico o se vuoi\n inserire la frequnza dopo)\n"
603 MESSAGEW12="Inserisci la frequenza per"
604 MESSAGEW13="\n\n(es. 2.412G, vuoto per automatico)"
605 MESSAGEW14="Inserisci la chiave crittografica\nper"
606 MESSAGEW15="\n\n(vuoto per trasmissione in chiaro, non raccomandato!)"
607 MESSAGEW16="Inserisci i parametri aggiuntivi per\n'iwconfig"
608 MESSAGEW17="' se necessario, es.\n\n\nsens -80 rts 512 frag 512 rate 5.5M"
609 MESSAGEW18="Inserisci parametri aggiuntivi per\n'iwspy"
610 MESSAGEW19="' se necessario\n\n\n"
611 MESSAGEW20="Inserisci parametri aggiuntivi per\n'iwpriv"
612 MESSAGEW21="' se necessario\n\n\n"
613 MESSAGEW22="Abilito il supporto WPA?"
614 MESSAGEW23="Inserisci la Passphrase di WPA\nper"
615 MESSAGEW25="Vuoi memorizzare la tua chiave WEP nel suo file riservato ("
616 MESSAGEW26=")? Se dici no, la tua chiave WEP sarà memorizzata nel file /etc/network/interfaces e sarà leggibile da tutti gli account del tuo sistema. Dovresti fare 'chmod 600 /etc/network/interfaces' se rispondi no a questa domanda"
617 MESSAGEW27="Is SSID broadcast enabled?"
620 NET_DEVICE_NAME="Carte_réseau"
621 MESSAGE0="Aucune carte réseau supportée trouvée."
622 MESSAGE1="Sélectionnez la carte réseau, svp"
623 MESSAGE2="Voulez-vous utiliser DHCP?"
624 MESSAGE3="Envoi de broadcast DHCP par la carte"
626 MESSAGE5="Appuyez sur Entrée pour quitter."
627 MESSAGE6="Entrez une adresse IP pour "
628 MESSAGE7="Entrez le Masque de Sous-réseau pour "
629 MESSAGE8="Entrez l'adresse Broadcast pour "
630 MESSAGE9="Entrez l'IP de la Passerelle par Défaut"
631 MESSAGE10="Entrez Les DNS de votre FAI"
632 MESSAGE11="Réglage des DNS dans /etc/resolv.conf"
633 MESSAGE12="Ajoût des DNS dans /etc/resolv.conf:"
634 MESSAGEW0="Aucune carte Wifi trouvée."
635 MESSAGEW1="Configuration des paramètres de réseau sans fil pour "
636 MESSAGEW3="SVP, Commencez par configurer les paramètres d'IP de l'interface!"
637 MESSAGEW4="Entrez l'ESSID pour"
638 MESSAGEW5="\n\n\n(ne rien mettre pour 'peu importe' n'est pas recommandé !)\n"
639 MESSAGEW6="Entrez le NWID (cell identifier)\npour"
640 MESSAGEW7=", si nécessaire\n\n\n"
641 MESSAGEW8="Entrez le mode pour "
642 MESSAGEW9="\n\n(Managed(=default), Ad-Hoc, Master,\nRepeater, Secondary, auto)\n"
643 MESSAGEW10="Entrez numéro de canal pour"
644 MESSAGEW11="\n\n(0 à 16, vide pour auto ou si vous voulez\n entrer la fréquence ensuite)\n"
645 MESSAGEW12="Entrez la fréquence pour"
646 MESSAGEW13="\n\n(ex: 2.412G, vide pour auto)"
647 MESSAGEW14="Entrez la clé de cryptage\npour"
648 MESSAGEW15="\n\n(vide pour texte en clair, non recommandé !!)"
649 MESSAGEW16="Entrez des paramètres additionnels pour\n'iwconfig"
650 MESSAGEW17="' si nécessaire, comme \n\n\nsens -80 rts 512 frag 512 rate 5.5M"
651 MESSAGEW18="Entrer des paramètres additionnels pour\n'iwspy"
652 MESSAGEW19="' si nécessaire\n\n\n"
653 MESSAGEW20="Entrer des paramètres additionnels pour\n'iwpriv"
654 MESSAGEW21="' si nécessaire\n\n\n"
655 MESSAGEW22="Activer la protection WPA?"
656 MESSAGEW23="Entrez le mot-de-passe WPA pour"
657 MESSAGEW25="Clé WEP sauvée dans un fichier privé ("
658 MESSAGEW26="? Si vous répondez non ici, la clé WEP sera stockée dans /etc/network/interfaces et pourra être accessible à tous les utilisateurs de la machine. Peut-être serait-il alors judicieux de fixer ainsi les droits de 'interfaces': 'chmod 600 /etc/network/interfaces'"
659 MESSAGEW27="Is SSID broadcast enabled?"
664 LAN=$(tail -n +3 /proc/net/dev|awk -F: '{print $1}'|sed "s/\s*//"|grep -v -e ^lo -e ^vmnet|sort)
665 [ -n "$WLAN" ] || WLAN=$(tail -n +3 /proc/net/wireless 2>/dev/null|awk -F: '{print $1}'|sort)
666 unset LAN_DEVICES WLAN_DEVICES FIREWIRE_DEVICES NETDEVICES
667 while read dev mac; do
668 #echo "Making NETDEVICES $NETDEVICESCOUNT $dev"
669 iswlan=$(echo $dev $WLAN|tr ' ' '\n'|sort|uniq -d)
671 grep auto /etc/network/interfaces | grep -q $dev && isauto="1"
672 driver=$(ethtool -i $dev 2>/dev/null|awk '/^driver:/{print $2}')
673 if [ "$driver" ]; then
674 if [ "$iswlan" ]; then
675 NETDEVICES[$NETDEVICESCOUNT]="$dev A::$isauto M::$mac D::$driver W::1 F::0"
677 NETDEVICES[$NETDEVICESCOUNT]="$dev A::$isauto M::$mac D::$driver W::0 F::0"
680 if [ "$iswlan" ]; then
681 NETDEVICES[$NETDEVICESCOUNT]="$dev A::$isauto M::$mac W::1 F::0"
683 NETDEVICES[$NETDEVICESCOUNT]="$dev A::$isauto M::$mac W::0 F::0"
686 #echo "Made to ${NETDEVICES[$NETDEVICESCOUNT]}"
687 ((NETDEVICESCOUNT++))
688 done < <(ifconfig -a|grep Ethernet|grep -v ^vmnet|awk '! /^\s/{print $1" "$5}')
690 if [ "$(ethtool -i $dev 2>/dev/null|awk '/^bus-info:/{print $2}')" == "ieee1394" ]; then
692 grep auto /etc/network/interfaces | grep -q $dev && isauto="1"
693 NETDEVICES[$NETDEVICESCOUNT]="$dev A::$isauto D::$(ethtool -i $dev 2>/dev/null|awk '/^driver:/{print $2}') W::0 F::1"
694 ((NETDEVICESCOUNT++))
698 #NETDEVICES="$(cat /proc/net/dev | awk -F: '/eth.:|lan.:|tr.:|wlan.:|ath.:|ra.:/{print $1}')"
700 if [ -z "$NETDEVICES" ]; then
701 $DIALOG --msgbox "$MESSAGE0" 15 45
705 count="$NETDEVICESCOUNT"
707 if [ "$count" -gt 1 ]; then
710 while [ $mycount -lt $count ]; do
711 DEVICE=${NETDEVICES[$mycount]}
712 #echo "$mycount is $DEVICE"
714 #echo "name: $DEVICENAME auto: $isauto fw: $isfirewire mac: $mac driver: $driver"
716 DEVICELIST="$DEVICELIST $mycount $MY_DEVICE_NAME"
723 EXITMENU="$EXITKEY Exit"
725 # main program loop until they bailout
727 # first get the device
728 if [ "$count" -gt 1 ]; then
730 $DIALOG --menu "$MESSAGE1" 18 60 12 $DEVICELIST $EXITMENU 2>"$TMP" || bailout
731 read DV <"$TMP" ; rm -f "$TMP"
732 [ "$DV" = "$EXITKEY" ] && bailout
736 # they have asked to stop configuring the interface so exit
737 [ -z "$IFACEDONE" ] || bailout
741 while [ -n "$DV" -a -z "$IFACEDONE" ]; do
746 $DIALOG --yesno "$MESSAGE14" 15 50 || IFACEDONE="DONE"
748 $DIALOG --yesno "$MESSAGE15" 15 50 && addauto || remauto
754 ## END OF FILE #################################################################