Author: biurrun Date: Fri Sep 4 18:39:24 2009 New Revision: 943 Log: Whitespace cosmetics; remove a pointless message. Modified: trunk/tools/switch-ip Modified: trunk/tools/switch-ip ============================================================================== --- trunk/tools/switch-ip Fri Sep 4 18:37:28 2009 (r942) +++ trunk/tools/switch-ip Fri Sep 4 18:39:24 2009 (r943) @@ -48,7 +48,7 @@ $@ } delroute() { - rt_entries=$(route -n |grep $IFWLAN) + rt_entries=$(route -n | grep $IFWLAN) if [ "x$rt_entries" = "x" ]; then return @@ -56,7 +56,7 @@ echo "$rt_entries" | while read line; do - target=$(echo $line | awk '{print $1}') + target=$(echo $line | awk '{print $1}') netmask=$(echo $line | awk '{print $3}') echo "Removing target $target(netmask $netmask) from the routing table..." @@ -224,45 +224,33 @@ case "$CMD" in arponly) run_verbose iwconfig $IFWLAN $IWCONFIG_OPTIONS - run_verbose arp -d $AP_IP 2> /dev/null ;; ifconfig) run_verbose iwconfig $IFWLAN $IWCONFIG_OPTIONS - run_verbose ifconfig $IFWLAN $NEW_IP netmask $NETMASK - # As arp cache sometimes causes wireless association to be confused, # we need to make sure that any arp entries for the new AP are deleted. # run_verbose arp -d $AP_IP # # arp -s $AP_IP $NEW_MAC_ADR - run_verbose route del -net $DESTINATION netmask $NETMASK 2> /dev/null if test $ROUTE_EXTRA_CMD; then run_verbose route add -net $DESTINATION netmask $NETMASK dev $IFWLAN fi run_verbose route add -net $DESTINATION netmask $NETMASK gw $AP_IP 2> /dev/null - # run_verbose ip -6 route del $DEST_IPV6 dev $IFDUMMY 2> /dev/null ;; dhcp) run_verbose iwconfig $IFWLAN essid "$NEW_SSID" ap "$NEW_MAC_ADR" - run_verbose killall $DHCP_CMD - run_verbose delroute - - echo "Getting a new IP configuration for $IFWLAN via DHCP..." run_verbose $DHCP_CMD $IFWLAN - run_verbose route add -net $DESTINATION netmask $NETMASK gw $AP_IP ;; channel) run_verbose iwconfig $IFWLAN essid $NEW_SSID channel 5 - run_verbose ifconfig $IFWLAN $NEW_IP - run_verbose route del -net $DESTINATION netmask $NETMASK 2> /dev/null run_verbose route add -net $DESTINATION netmask $NETMASK gw $AP_IP 2> /dev/null ;;