vediamo un po'...
ho modificato lo script in questo modo per far si che vengano scelte automaticamente delle impostazioni a seconda della rete riconosciuta.. dovrebbe funzionare...codice:#! /bin/sh # /etc/init.d/avvia_rete # case "$1" in start) echo "Configuro la scheda Wi-Fi" if [! -z `iwlist eth1 scan | grep ZyXEL`] then iwconfig eth1 essid ZyXEL enc XXX dhclient eth1 exit 1; elif [! -z `iwlist eth1 scan | grep DLINK_WIRELESS`] iwconfig eth1 essid DLINK_WIRELSS enc XXX dhclient eth1 echo "nameserver 130.244.127.161" > /etc/resolv.conf echo "nameserver 130.244.127.169" >> /etc/resolv.conf exit 1; elif [! -z `iwlist eth1 scan | grep WLAN`] iwconfig eth1 essid WLAN enc XXX dhclient eth1 exit 1; elif [! -z `iwlist eth1 scan | grep lynksis`] iwconfig eth1 essid lynksis enc XXX dhclient eth1 exit 1; elif [! -z `iwlist eth1 scan | INGW2A`] iwconfig eth1 INGW2A dhclient eth1 exit 1; elif [! -z `iwlist eth1 scan`] echo "Nessuna rete nota riconosciuta..." exit 1; fi echo "Nessuna rete riconosciuta... :(" exit 1; ;; stop) echo "Deconfiguro la scheda Wi-Fi" ifconfig eth1 down exit 1; ;; reload) echo "Nuova richiesta DHCP..." dhclient eth1 exit 1; ;; force-reload) echo "Rimozione module ipw3945" modprobe -r ipw3945 echo "Carimamento modulo ipw3945" modprobe ipw3945 ***devo richiamare la funzione start!!*** exit 1; ;; *) echo "Usage: /etc/init.d/avvia_rete {start|stop|reload|force-reload}" exit 1; ;; esac exit 0
ultimo piccolo problema
nel case FORCE-RELOAD dovrei richiamare esattamente il case START... è possibile farlo (e come...) o devo fare copia incolla?
grazie mille
ciao