Fernan Bolando wrote:
Hi all
Can anybody share there wifi startup scripts? I wrote a few scripts that I manually run to select whether I will connect through the wifi or ethernet.
I was wondering if you guys are using something else that works more like the way crux is organized.
I hope that question was clear :)
thanks fernan
Hi, sorry for the late reply. This is what I use. I've XXXXed out parts you don't need to see but you get the idea. I have this in /etc/rc.d/ and run it from rc.conf. I comment it out when I'm travelling and start wifi manually then. The sleep command is needed for ipw3945d to initialize before trying to access the card. HTH. Joe #!/bin/sh # # /etc/rc.d/net: start/stop wifi # case $1 in start) /usr/sbin/ipw3945d sleep 5 /sbin/ifconfig eth1 192.168.102.4 netmask 255.255.255.0 /sbin/route add default gw 192.168.102.1 /usr/sbin/iwconfig eth1 essid XXXXXXXXX /usr/sbin/iwconfig eth1 key open s:XXXXX /usr/sbin/iwconfig eth1 mode managed /bin/umount /home/ftp /usr/bin/smbmount //lhgw4/src /mnt/src -o password="",uid=100,gid=100,dmask=755,fmask=644 /usr/bin/smbmount //lhgw4/ftp /mnt/ftp -o password="",uid=100,gid=100,dmask=755,fmask=644 ;; stop) /bin/umount /mnt/ftp /bin/umount /mnt/src /sbin/ifconfig eth1 down /usr/sbin/ipw3945d --kill ;; restart) $0 stop $0 start ;; *) echo "usage: $0 [start|stop|restart]" ;; esac