#!/bin/csh -f # iwconfig eth1 essid cs-wl-1 key 6957xxxxxxxxxxxxxxxxxxxxxx /usr/local/bin/wireless-unencrypted if ($status == 0) then echo "network up on unencrypted network." exit endif cat < /etc/sysconfig/network-scripts/ifcfg-eth1 DEVICE=eth1 BOOTPROTO=dhcp NETMASK=255.255.255.0 ONBOOT=yes MII_NOT_SUPPORTED=yes NEEDHOSTNAME=yes WIRELESS_MODE=Managed WIRELESS_ESSID="CS-WL-1" WIRELESS_ENC_KEY=5769-xxxx-xxxx-xxxx-xxxx-xxxx-xx EOF killall ifplugd killall zcip rmmod orinoco_cs rmmod orinoco sleep 1 /etc/init.d/pcmcia stop while (`netstat -rn|grep -c "^0.0.0.0"`) echo "route still exists" sleep 1 end /etc/init.d/pcmcia start @ count = 0 # 0.0.0.0 will not exist until the network comes back up while (`netstat -rn|grep -c "^0.0.0.0"` == 0 && $count < 10) echo "route not setup yet" @ count++ sleep 1 end if ($count >= 10) then echo "network not setup" else echo "network up on encrypted network..." endif # reset file so that it defaults to unencrypted network on reboot... cat < /etc/sysconfig/network-scripts/ifcfg-eth1 DEVICE=eth1 BOOTPROTO=dhcp NETMASK=255.255.255.0 ONBOOT=yes MII_NOT_SUPPORTED=yes NEEDHOSTNAME=yes WIRELESS_MODE=Managed EOF