#!/bin/csh -f # default timeout set to 10 seconds. @ max = 10 killall ifplugd killall zcip rmmod orinoco_cs rmmod orinoco sleep 1 /etc/init.d/pcmcia stop echo "attempted unencrypted network..." 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 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 < $max) echo "route not setup yet" @ count++ sleep 1 end if ($count >= $max) then echo "network not setup" exit 10 endif echo "network up" exit 0