dhclient-script (148420) | dhclient-script (149479) |
---|---|
1#!/bin/sh 2# 3# $OpenBSD: dhclient-script,v 1.6 2004/05/06 18:22:41 claudio Exp $ | 1#!/bin/sh 2# 3# $OpenBSD: dhclient-script,v 1.6 2004/05/06 18:22:41 claudio Exp $ |
4# $FreeBSD: head/sbin/dhclient/dhclient-script 148420 2005-07-26 18:27:37Z brooks $ | 4# $FreeBSD: head/sbin/dhclient/dhclient-script 149479 2005-08-26 01:02:38Z brooks $ |
5# 6# Copyright (c) 2003 Kenneth R Westerback <krw@openbsd.org> 7# 8# Permission to use, copy, modify, and distribute this software for any 9# purpose with or without fee is hereby granted, provided that the above 10# copyright notice and this permission notice appear in all copies. 11# 12# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --- 56 unchanged lines hidden (view full) --- 69 $LOGGER "New Subnet Mask ($interface): $new_subnet_mask" 70 $LOGGER "New Broadcast Address ($interface): $new_broadcast_address" 71 $LOGGER "New Routers ($interface): $new_routers" 72} 73 74delete_old_alias() { 75 if [ -n "$alias_ip_address" ]; then 76 ifconfig $interface inet -alias $alias_ip_address > /dev/null 2>&1 | 5# 6# Copyright (c) 2003 Kenneth R Westerback <krw@openbsd.org> 7# 8# Permission to use, copy, modify, and distribute this software for any 9# purpose with or without fee is hereby granted, provided that the above 10# copyright notice and this permission notice appear in all copies. 11# 12# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --- 56 unchanged lines hidden (view full) --- 69 $LOGGER "New Subnet Mask ($interface): $new_subnet_mask" 70 $LOGGER "New Broadcast Address ($interface): $new_broadcast_address" 71 $LOGGER "New Routers ($interface): $new_routers" 72} 73 74delete_old_alias() { 75 if [ -n "$alias_ip_address" ]; then 76 ifconfig $interface inet -alias $alias_ip_address > /dev/null 2>&1 |
77 route delete $alias_ip_address $LOCALHOST > /dev/null 2>&1 | 77 #route delete $alias_ip_address $LOCALHOST > /dev/null 2>&1 |
78 fi 79} 80 81add_new_alias() { 82 if [ -n "$alias_ip_address" ]; then 83 ifconfig $interface inet alias $alias_ip_address netmask \ 84 $alias_subnet_mask | 78 fi 79} 80 81add_new_alias() { 82 if [ -n "$alias_ip_address" ]; then 83 ifconfig $interface inet alias $alias_ip_address netmask \ 84 $alias_subnet_mask |
85 route add $alias_ip_address $LOCALHOST | 85 #route add $alias_ip_address $LOCALHOST |
86 fi 87} 88 89delete_old_routes() { | 86 fi 87} 88 89delete_old_routes() { |
90 route delete "$old_ip_address" $LOCALHOST >/dev/null 2>&1 | 90 #route delete "$old_ip_address" $LOCALHOST >/dev/null 2>&1 |
91 for router in $old_routers; do 92 if [ $if_defaultroute = x -o $if_defaultroute = $interface ]; then 93 route delete default $route >/dev/null 2>&1 94 fi 95 done 96 97 if [ -n "$old_static_routes" ]; then 98 set $old_static_routes 99 while [ $# -gt 1 ]; do 100 route delete "$1" "$2" 101 shift; shift 102 done 103 fi 104 105 arp_flush 106} 107 108add_new_routes() { | 91 for router in $old_routers; do 92 if [ $if_defaultroute = x -o $if_defaultroute = $interface ]; then 93 route delete default $route >/dev/null 2>&1 94 fi 95 done 96 97 if [ -n "$old_static_routes" ]; then 98 set $old_static_routes 99 while [ $# -gt 1 ]; do 100 route delete "$1" "$2" 101 shift; shift 102 done 103 fi 104 105 arp_flush 106} 107 108add_new_routes() { |
109 route add $new_ip_address $LOCALHOST >/dev/null 2>&1 | 109 #route add $new_ip_address $LOCALHOST >/dev/null 2>&1 |
110 for router in $new_routers; do 111 if [ "$new_ip_address" = "$router" ]; then 112 route add default -iface $router >/dev/null 2>&1 113 else 114 route add default $router >/dev/null 2>&1 115 fi 116 # 2nd and subsequent default routers error out, so explicitly 117 # stop processing the list after the first one. --- 164 unchanged lines hidden --- | 110 for router in $new_routers; do 111 if [ "$new_ip_address" = "$router" ]; then 112 route add default -iface $router >/dev/null 2>&1 113 else 114 route add default $router >/dev/null 2>&1 115 fi 116 # 2nd and subsequent default routers error out, so explicitly 117 # stop processing the list after the first one. --- 164 unchanged lines hidden --- |