|
Lines 37-43
Link Here
|
| 37 |
|
37 |
|
| 38 |
# If the current address does not match or we are deconfiguring |
38 |
# If the current address does not match or we are deconfiguring |
| 39 |
# then we take the all the addresses on the interface down |
39 |
# then we take the all the addresses on the interface down |
| 40 |
cur=$( ifconfig ${interface} | grep 'inet ' | awk -F: '{ print $2,$3 }' | awk '{ print $1,$3 }' ) |
40 |
cur=$( ifconfig ${interface} | grep 'inet ' | awk -F: '{ print $2,$4 }' | awk '{ print $1,$3 }' ) |
| 41 |
if [[ ${cur} != "${ip} ${subnet}" || ${action} == deconfig ]]; then |
41 |
if [[ ${cur} != "${ip} ${subnet}" || ${action} == deconfig ]]; then |
| 42 |
# Remove all aliases |
42 |
# Remove all aliases |
| 43 |
for i in $( ifconfig | grep -o "^${interface}:[0-9]*" | tac | xargs ); do |
43 |
for i in $( ifconfig | grep -o "^${interface}:[0-9]*" | tac | xargs ); do |
|
Lines 68-74
Link Here
|
| 68 |
# Configure our routers |
68 |
# Configure our routers |
| 69 |
for r in ${router}; do |
69 |
for r in ${router}; do |
| 70 |
while true; do |
70 |
while true; do |
| 71 |
/sbin/route del 0.0.0.0 2>/dev/null || break |
71 |
/sbin/route del default 2>/dev/null || break |
| 72 |
done |
72 |
done |
| 73 |
|
73 |
|
| 74 |
# We can only have one default route! |
74 |
# We can only have one default route! |