dhclient-script (147086) | dhclient-script (147138) |
---|---|
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 147086 2005-06-07 04:32:29Z brooks $ | 4# $FreeBSD: head/sbin/dhclient/dhclient-script 147138 2005-06-08 18:21:56Z 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 --- 154 unchanged lines hidden (view full) --- 167 chmod -RL 644 /etc/resolv.conf 168 169 return 0 170 fi 171 172 return 1 173} 174 | 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 --- 154 unchanged lines hidden (view full) --- 167 chmod -RL 644 /etc/resolv.conf 168 169 return 0 170 fi 171 172 return 1 173} 174 |
175# Must be used on exit. Invokes the local dhcp client exit hooks, if any. 176exit_with_hooks() { 177 exit_status=$1 178 if [ -f /etc/dhclient-exit-hooks ]; then 179 . /etc/dhclient-exit-hooks 180 fi 181 # probably should do something with exit status of the local script 182 exit $exit_status 183} 184 |
|
175# 176# Start of active code. 177# 178 179if [ -x $NETSTAT ]; then 180 if_defaulroute=`$NETSTAT -rn | $GREP "^default" | $AWK '{print $6}'` 181else 182 if_defaultroute="x" --- 59 unchanged lines hidden (view full) --- 242 $LOGGER "New Routers ($interface): $new_routers" 243 set "$new_routers" 244 if ping -q -c 1 -w 1 "$1"; then 245 if [ "$new_ip_address" != "$alias_ip_address" ]; then 246 add_new_alias 247 fi 248 add_new_routes 249 if add_new_resolv_conf; then | 185# 186# Start of active code. 187# 188 189if [ -x $NETSTAT ]; then 190 if_defaulroute=`$NETSTAT -rn | $GREP "^default" | $AWK '{print $6}'` 191else 192 if_defaultroute="x" --- 59 unchanged lines hidden (view full) --- 252 $LOGGER "New Routers ($interface): $new_routers" 253 set "$new_routers" 254 if ping -q -c 1 -w 1 "$1"; then 255 if [ "$new_ip_address" != "$alias_ip_address" ]; then 256 add_new_alias 257 fi 258 add_new_routes 259 if add_new_resolv_conf; then |
250 exit 0 | 260 exit_with_hooks 0 |
251 fi 252 fi 253 fi 254 ifconfig $interface inet -alias $new_ip_address $medium 255 delete_old_routes | 261 fi 262 fi 263 fi 264 ifconfig $interface inet -alias $new_ip_address $medium 265 delete_old_routes |
256 exit 1 | 266 exit_with_hooks 1 |
257 ;; 258esac 259 | 267 ;; 268esac 269 |
260exit 0 | 270exit_with_hooks 0 |