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: Mon Apr 17 21:48:36 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"
434 [ -f /etc/sysconfig/i18n ] && . /etc/sysconfig/i18n
436 # Default all strings to English
437 NET_DEVICE_NAME="Network_device"
438 NET_DEVICE_NAME_W="Wireless_device"
439 NET_DEVICE_NAME_FW="Firewire_device"
440 NET_DEVICE_NAME_AUTO="Auto"
441 MESSAGE0="No supported network cards found."
442 MESSAGE1="Please select network device"
443 MESSAGE2="Use DHCP broadcast?"
444 MESSAGE3="Sending DHCP broadcast from device"
446 MESSAGE5="Hit return to exit."
447 MESSAGE6="Please enter IP Address for "
448 MESSAGE7="Please enter Network Mask for "
449 MESSAGE8="Please enter Broadcast Address for "
450 MESSAGE9="Please enter Default Gateway"
451 MESSAGE10="Please enter Nameserver(s)"
452 MESSAGE11="Setting Nameserver in /etc/resolv.conf to"
453 MESSAGE12="Adding Nameserver to /etc/resolv.conf:"
454 MESSAGE13="Setup wireless options?"
455 MESSAGE14="Failed to bring up the interface, would you like to reconfigure it?"
456 MESSAGE15="Interface enabled, do you want it auto enabled at boot?"
457 MESSAGEW0="No wireless network card found."
458 MESSAGEW1="Configuration of wireless parameters for"
459 MESSAGEW3="Please configure IP parameters of the interface first"
460 MESSAGEW4="Enter the ESSID for"
461 MESSAGEW5="\n\n\n(empty for 'any', not recommended !)\n"
462 MESSAGEW6="Enter the NWID (cell identifier)\nfor"
463 MESSAGEW7=", if needed\n\n\n"
464 MESSAGEW8="Enter the mode for"
465 MESSAGEW9="\n\n(Managed(=default), Ad-Hoc, Master,\nRepeater, Secondary, auto)\n"
466 MESSAGEW10="Enter channel number for"
467 MESSAGEW11="\n\n(0 bis 16, empty for auto or if you want to\n enter the frequency next)\n"
468 MESSAGEW12="Enter the frequency for"
469 MESSAGEW13="\n\n(e.g 2.412G, empty for auto)"
470 MESSAGEW14="Enter the encryption key\nfor"
471 MESSAGEW15="\n\n(empty for cleartext, not recommended !!)"
472 MESSAGEW16="Enter additional parameters for\n'iwconfig"
473 MESSAGEW17="' if needed, e.g.\n\n\nsens -80 rts 512 frag 512 rate 5.5M"
474 MESSAGEW18="Enter additional parameters for\n'iwspy"
475 MESSAGEW19="' if needed\n\n\n"
476 MESSAGEW20="Enter additional parameters for\n'iwpriv"
477 MESSAGEW21="' if needed\n\n\n"
478 MESSAGEW22="Enable WPA support?"
479 MESSAGEW23="Enter the WPA passphrase (passphrase must be 8..63 characters) for"
480 MESSAGEW25="Would you like to store your wep key in it's own private file ("
481 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"
482 MESSAGEW27="Is SSID broadcast enabled?"
486 NET_DEVICE_NAME="Netzwerkkarte"
487 MESSAGE0="Keine unterstützten Netzwerkkarte(n) gefunden."
488 MESSAGE1="Bitte Netzwerkkarte auswählen"
489 MESSAGE2="DHCP Broadcast zur Konfiguration benutzen? (Nein=manuell)"
490 MESSAGE3="Sende DHCP Broadcast von Netzwerkkarte"
491 MESSAGE4="Fehlgeschlagen."
492 MESSAGE5="Eingabetaste zum Beenden."
493 MESSAGE6="Bitte geben Sie die IP-Adresse ein für "
494 MESSAGE7="Bitte geben Sie die Netzwerk-Maske ein für "
495 MESSAGE8="Bitte geben Sie die Broadcast-Adresse ein für "
496 MESSAGE9="Bitte geben Sie das Default-Gateway ein"
497 MESSAGE10="Bitte geben Sie den/die Nameserver ein"
498 MESSAGE11="Setze Nameserver in /etc/resolv.conf auf "
499 MESSAGE12="Füge Nameserver in /etc/resolv.conf hinzu:"
500 MESSAGE13="WLAN-Einstellungen konfigurieren?"
501 MESSAGE14="Fehler beim Aktivieren des Interface, wollen Sie es neu konfigurieren?"
502 MESSAGE15="Interface aktiviert, beim Systemstart automatisch aktivieren?"
503 MESSAGEW0="Keine Wireless-Netzwerkkarte gefunden."
504 MESSAGEW1="Konfiguration der Wireless-Parameter von"
505 MESSAGEW2="Bitte Wireless-Netzwerkkarte auswählen"
506 MESSAGEW3="Bitte konfigurieren Sie vorher die IP-Parameter der Karte !"
507 MESSAGEW4="Geben Sie die ESSID für"
508 MESSAGEW5="ein\n\n\n(leer für 'any', nicht zu empfehlen !!)\n"
509 MESSAGEW6="Geben Sie ggf. die NWID (Cell Identifier)\nfür"
510 MESSAGEW7="ein, falls es eine gibt\n\n\n"
511 MESSAGEW8="Geben Sie den Modus für"
512 MESSAGEW9="ein\n\n(Managed(=default), Ad-Hoc, Master,\nRepeater, Secondary, auto)\n"
513 MESSAGEW10="Geben Sie den Kanal für"
514 MESSAGEW11="ein\n\n(0 bis 16, leer für auto oder Frequenz-\neingabe im nächsten Fenster)\n"
515 MESSAGEW12="Geben Sie die Frequenz für"
516 MESSAGEW13="ein\n\n(z.B. 2.412G, leer für auto)"
517 MESSAGEW14="Geben Sie den Verschlüsselungs-Key\nfür"
518 MESSAGEW15="ein\n\n(leer für Klartext, nicht zu empfehlen !!)"
519 MESSAGEW16="Geben Sie ggf. zusätzliche Parameter für\n'iwconfig"
520 MESSAGEW17="' ein, z.B.\n\n\nsens -80 rts 512 frag 512 rate 5.5M"
521 MESSAGEW18="Geben Sie ggf. zusätzliche Parameter für\n'iwspy"
522 MESSAGEW19="' ein\n\n\n"
523 MESSAGEW20="Geben Sie ggf. zusätzliche Parameter für\n'iwpriv"
524 MESSAGEW21="' ein\n\n\n"
525 MESSAGEW22="WPA-Unterstützung aktivieren?"
526 MESSAGEW23="WPA-Passwort eingeben für"
527 MESSAGEW25="WEP-Schlüssel in privater Datei abspeichern ("
528 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."
529 MESSAGEW27="Ist SSID Broadcast aktiviert?"
532 NET_DEVICE_NAME="Dispositivo_de_la_red"
533 MESSAGE0="Se han encontrado tarjetas de red no soportadas."
534 MESSAGE1="Por favor, seleccione el dispositivo fisico de red"
535 MESSAGE2="¿Utilizar broadcast DHCP?"
536 MESSAGE3="Enviando broadcast DHCP desde el dispositivo"
538 MESSAGE5="Pulse enter para salir."
539 MESSAGE6="Por favor, inserte la dirección IP para "
540 MESSAGE7="Por favor, inserte la máscara de red para "
541 MESSAGE8="Por favor, inserte la dirección de Broadcast para "
542 MESSAGE9="Por favor, inserte la puerta de enlace por defecto"
543 MESSAGE10="Por favor, inserte los servidores DNS"
544 MESSAGE11="Poniendo los servidores de nombres de /etc/resolv.conf a "
545 MESSAGE12="Adicionando servidor DNS a /etc/resolv.conf:"
546 MESSAGEW0="No se ha encontrado una tarjeta inalámbrica."
547 MESSAGEW1="Configuración de los parámetros inalámbricos para"
548 MESSAGEW2="Por favor, seleccione un dispositivo de red inalámbrico"
549 MESSAGEW3="Por favor, configure primero los parámetros de la IP para la interfaz"
550 MESSAGEW4="Teclee el ESSID para"
551 MESSAGEW5="\n\n\n(vacío para 'cualquiera', ¡no recomendado!)\n"
552 MESSAGEW6="Teclee el NWID (identificador de celda)\npara"
553 MESSAGEW7=", si es necesario\n\n\n"
554 MESSAGEW8="Teclee el modo para"
555 MESSAGEW9="\n\n(Managed(=por_defecto), Ad-Hoc, Master,\nRepeater, Secondary, auto)\n"
556 MESSAGEW10="Teclee el número del canal para"
557 MESSAGEW11="\n\n(0 bis 16, vacío para auto o si lo prefiere\n teclee la frecuencia seguidamente)\n"
558 MESSAGEW12="Teclee la frecuencia para"
559 MESSAGEW13="\n\n(ej. 2.412G, vacío para auto)"
560 MESSAGEW14="Teclee la clave de encriptación\npara"
561 MESSAGEW15="\n\n(vacío para texto plano, ¡¡no recomendado!!)"
562 MESSAGEW16="Teclee los parámetros adicionales para\n'iwconfig"
563 MESSAGEW17="' Si es necesario, ej.\n\n\nsens -80 rts 512 frag 512 rate 5.5M"
564 MESSAGEW18="Teclee los parámetros adicionales para\n'iwspy"
565 MESSAGEW19="' si es necesario\n\n\n"
566 MESSAGEW20="Teclee los parámetros adicionales para\n'iwpriv"
567 MESSAGEW21="' si es necesario\n\n\n"
570 NET_DEVICE_NAME="Periferica_di_rete"
571 NET_DEVICE_NAME_W="Periferica_Wireless"
572 NET_DEVICE_NAME_FW="Periferica_Firewire"
573 NET_DEVICE_NAME_AUTO="Automatico"
574 MESSAGE0="Non ho trovato schede di rete supportate."
575 MESSAGE1="Per favore seleziona la periferica di rete"
576 MESSAGE2="Devo utilizzare il broadcast DHCP?"
577 MESSAGE3="Sto inviando il broadcast DHCP dalla periferica"
579 MESSAGE5="Premi invio per uscire."
580 MESSAGE6="Inserisci l'indirizzo IP per "
581 MESSAGE7="Inserisci la maschera di rete per "
582 MESSAGE8="Inserisci l'indirizzo di broadcast per "
583 MESSAGE9="Inserisci il Gateway di default"
584 MESSAGE10="Inserisci i Nameserver"
585 MESSAGE11="Sto settando i Nameserver in /etc/resolv.conf a"
586 MESSAGE12="Aggiungo i Nameserver in /etc/resolv.conf:"
587 MESSAGE13="Configuro le opzioni del wireless?"
588 MESSAGE14="Non riesco ad attivare l'interfaccia, vuoi riconfigurarla?"
589 MESSAGE15="Interfaccia attiva, vuoi abilitarla automaticamente all'avvio?"
590 MESSAGEW0="Nessuna scheda di rete wireless trovata."
591 MESSAGEW1="Configurazione dei parametri wireless per"
592 MESSAGEW3="Configura i parametri IP dell'interfaccia per prima cosa!"
593 MESSAGEW4="Inserisci l'ESSID per"
594 MESSAGEW5="\n\n\n(vuoto per 'tutti', non raccomandato!)\n"
595 MESSAGEW6="Inserisci il NWID (cell identifier)\nper"
596 MESSAGEW7=", se necessario\n\n\n"
597 MESSAGEW8="Inserisci la modalità per"
598 MESSAGEW9="\n\n(Managed(=default), Ad-Hoc, Master,\nRepeater, Secondary, auto)\n"
599 MESSAGEW10="Inserisci il numero di canale per"
600 MESSAGEW11="\n\n(da 0 a 16, vuoto per automatico o se vuoi\n inserire la frequnza dopo)\n"
601 MESSAGEW12="Inserisci la frequenza per"
602 MESSAGEW13="\n\n(es. 2.412G, vuoto per automatico)"
603 MESSAGEW14="Inserisci la chiave crittografica\nper"
604 MESSAGEW15="\n\n(vuoto per trasmissione in chiaro, non raccomandato!)"
605 MESSAGEW16="Inserisci i parametri aggiuntivi per\n'iwconfig"
606 MESSAGEW17="' se necessario, es.\n\n\nsens -80 rts 512 frag 512 rate 5.5M"
607 MESSAGEW18="Inserisci parametri aggiuntivi per\n'iwspy"
608 MESSAGEW19="' se necessario\n\n\n"
609 MESSAGEW20="Inserisci parametri aggiuntivi per\n'iwpriv"
610 MESSAGEW21="' se necessario\n\n\n"
611 MESSAGEW22="Abilito il supporto WPA?"
612 MESSAGEW23="Inserisci la Passphrase di WPA\nper"
613 MESSAGEW25="Vuoi memorizzare la tua chiave WEP nel suo file riservato ("
614 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"
615 MESSAGEW27="Is SSID broadcast enabled?"
618 NET_DEVICE_NAME="Carte_réseau"
619 MESSAGE0="Aucune carte réseau supportée trouvée."
620 MESSAGE1="Sélectionnez la carte réseau, svp"
621 MESSAGE2="Voulez-vous utiliser DHCP?"
622 MESSAGE3="Envoi de broadcast DHCP par la carte"
624 MESSAGE5="Appuyez sur Entrée pour quitter."
625 MESSAGE6="Entrez une adresse IP pour "
626 MESSAGE7="Entrez le Masque de Sous-réseau pour "
627 MESSAGE8="Entrez l'adresse Broadcast pour "
628 MESSAGE9="Entrez l'IP de la Passerelle par Défaut"
629 MESSAGE10="Entrez Les DNS de votre FAI"
630 MESSAGE11="Réglage des DNS dans /etc/resolv.conf"
631 MESSAGE12="Ajoût des DNS dans /etc/resolv.conf:"
632 MESSAGEW0="Aucune carte Wifi trouvée."
633 MESSAGEW1="Configuration des paramètres de réseau sans fil pour "
634 MESSAGEW3="SVP, Commencez par configurer les paramètres d'IP de l'interface!"
635 MESSAGEW4="Entrez l'ESSID pour"
636 MESSAGEW5="\n\n\n(ne rien mettre pour 'peu importe' n'est pas recommandé !)\n"
637 MESSAGEW6="Entrez le NWID (cell identifier)\npour"
638 MESSAGEW7=", si nécessaire\n\n\n"
639 MESSAGEW8="Entrez le mode pour "
640 MESSAGEW9="\n\n(Managed(=default), Ad-Hoc, Master,\nRepeater, Secondary, auto)\n"
641 MESSAGEW10="Entrez numéro de canal pour"
642 MESSAGEW11="\n\n(0 à 16, vide pour auto ou si vous voulez\n entrer la fréquence ensuite)\n"
643 MESSAGEW12="Entrez la fréquence pour"
644 MESSAGEW13="\n\n(ex: 2.412G, vide pour auto)"
645 MESSAGEW14="Entrez la clé de cryptage\npour"
646 MESSAGEW15="\n\n(vide pour texte en clair, non recommandé !!)"
647 MESSAGEW16="Entrez des paramètres additionnels pour\n'iwconfig"
648 MESSAGEW17="' si nécessaire, comme \n\n\nsens -80 rts 512 frag 512 rate 5.5M"
649 MESSAGEW18="Entrer des paramètres additionnels pour\n'iwspy"
650 MESSAGEW19="' si nécessaire\n\n\n"
651 MESSAGEW20="Entrer des paramètres additionnels pour\n'iwpriv"
652 MESSAGEW21="' si nécessaire\n\n\n"
653 MESSAGEW22="Activer la protection WPA?"
654 MESSAGEW23="Entrez le mot-de-passe WPA pour"
655 MESSAGEW25="Clé WEP sauvée dans un fichier privé ("
656 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'"
657 MESSAGEW27="Is SSID broadcast enabled?"
662 LAN=$(tail +3 /proc/net/dev|awk -F: '{print $1}'|sed "s/\s*//"|grep -v -e ^lo -e ^vmnet|sort)
663 [ -n "$WLAN" ] || WLAN=$(tail +3 /proc/net/wireless|awk -F: '{print $1}'|sort)
664 unset LAN_DEVICES WLAN_DEVICES FIREWIRE_DEVICES NETDEVICES
665 while read dev mac; do
666 #echo "Making NETDEVICES $NETDEVICESCOUNT $dev"
667 iswlan=$(echo $dev $WLAN|tr ' ' '\n'|sort|uniq -d)
669 grep auto /etc/network/interfaces | grep -q $dev && isauto="1"
670 driver=$(ethtool -i $dev 2>/dev/null|awk '/^driver:/{print $2}')
671 if [ "$driver" ]; then
672 if [ "$iswlan" ]; then
673 NETDEVICES[$NETDEVICESCOUNT]="$dev A::$isauto M::$mac D::$driver W::1 F::0"
675 NETDEVICES[$NETDEVICESCOUNT]="$dev A::$isauto M::$mac D::$driver W::0 F::0"
678 if [ "$iswlan" ]; then
679 NETDEVICES[$NETDEVICESCOUNT]="$dev A::$isauto M::$mac W::1 F::0"
681 NETDEVICES[$NETDEVICESCOUNT]="$dev A::$isauto M::$mac W::0 F::0"
684 #echo "Made to ${NETDEVICES[$NETDEVICESCOUNT]}"
685 ((NETDEVICESCOUNT++))
686 done < <(ifconfig -a|grep Ethernet|grep -v ^vmnet|awk '! /^\s/{print $1" "$5}')
688 if [ "$(ethtool -i $dev 2>/dev/null|awk '/^bus-info:/{print $2}')" == "ieee1394" ]; then
690 grep auto /etc/network/interfaces | grep -q $dev && isauto="1"
691 NETDEVICES[$NETDEVICESCOUNT]="$dev A::$isauto D::$(ethtool -i $dev 2>/dev/null|awk '/^driver:/{print $2}') W::0 F::1"
692 ((NETDEVICESCOUNT++))
696 #NETDEVICES="$(cat /proc/net/dev | awk -F: '/eth.:|lan.:|tr.:|wlan.:|ath.:|ra.:/{print $1}')"
698 if [ -z "$NETDEVICES" ]; then
699 $DIALOG --msgbox "$MESSAGE0" 15 45
703 count="$NETDEVICESCOUNT"
705 if [ "$count" -gt 1 ]; then
708 while [ $mycount -lt $count ]; do
709 DEVICE=${NETDEVICES[$mycount]}
710 #echo "$mycount is $DEVICE"
712 #echo "name: $DEVICENAME auto: $isauto fw: $isfirewire mac: $mac driver: $driver"
714 DEVICELIST="$DEVICELIST $mycount $MY_DEVICE_NAME"
721 EXITMENU="$EXITKEY Exit"
723 # main program loop until they bailout
725 # first get the device
726 if [ "$count" -gt 1 ]; then
728 $DIALOG --menu "$MESSAGE1" 18 60 12 $DEVICELIST $EXITMENU 2>"$TMP" || bailout
729 read DV <"$TMP" ; rm -f "$TMP"
730 [ "$DV" = "$EXITKEY" ] && bailout
734 # they have asked to stop configuring the interface so exit
735 [ -z "$IFACEDONE" ] || bailout
739 while [ -n "$DV" -a -z "$IFACEDONE" ]; do
744 $DIALOG --yesno "$MESSAGE14" 15 50 || IFACEDONE="DONE"
746 $DIALOG --yesno "$MESSAGE15" 15 50 && addauto || remauto
752 ## END OF FILE #################################################################