2008-09-13 00:24:42 +02:00
|
|
|
--- client/dhclient-script.8
|
2009-12-16 16:52:02 +01:00
|
|
|
+++ client/dhclient-script.8 2009/05/04 09:54:05
|
|
|
|
@@ -45,9 +45,10 @@
|
2008-09-13 00:24:42 +02:00
|
|
|
This script is not meant to be customized by the end user. If local
|
|
|
|
customizations are needed, they should be possible using the enter and
|
|
|
|
exit hooks provided (see HOOKS for details). These hooks will allow the
|
|
|
|
-user to override the default behaviour of the client in creating a
|
|
|
|
+user to override the default behaviour of the client in applying of
|
|
|
|
+additional settings like DNS (e.g. creating a
|
|
|
|
.B /etc/resolv.conf
|
|
|
|
-file.
|
|
|
|
+file), NTP or YP to the system.
|
|
|
|
.PP
|
|
|
|
No standard client script exists for some operating systems, even though
|
|
|
|
the actual client may work, so a pioneering user may well need to create
|
2009-12-16 16:52:02 +01:00
|
|
|
@@ -59,12 +60,43 @@
|
2008-09-13 00:24:42 +02:00
|
|
|
.B ETCDIR/dhclient.conf
|
|
|
|
or using the enter and exit hooks, please submit a bug report.
|
|
|
|
.SH HOOKS
|
|
|
|
-When it starts, the client script first defines a shell function,
|
|
|
|
-.B make_resolv_conf ,
|
|
|
|
-which is later used to create the
|
|
|
|
+When it starts, the client script first defines several shell functions:
|
|
|
|
+.BR use_netconfig ,
|
|
|
|
+.BR netconfig_modify ,
|
|
|
|
+.BR netconfig_remove ,
|
|
|
|
+.BR make_resolv_conf ,
|
|
|
|
+and
|
|
|
|
+.BR restore_resolv_conf .
|
|
|
|
+These functions are later used to apply DNS, NTP, YP, and other additional
|
|
|
|
+settings to the system.
|
|
|
|
+
|
|
|
|
+The
|
|
|
|
+.B use_netconfig
|
|
|
|
+returns true (0), when the /sbin/netconfig script is installed and enables
|
|
|
|
+the use of the
|
|
|
|
+.B netconfig_modify
|
|
|
|
+and
|
|
|
|
+.B netconfig_remove
|
|
|
|
+functions.
|
|
|
|
+.br
|
|
|
|
+Otherwise, the
|
|
|
|
+.BR make_resolv_conf
|
|
|
|
+and
|
|
|
|
+.BR restore_resolv_conf
|
|
|
|
+functions are used. These functions are modified to create
|
|
|
|
+/var/lib/dhcp/resolv.conf.dhclient.$interface files only
|
|
|
|
+instead of the
|
|
|
|
.B /etc/resolv.conf
|
|
|
|
-file. To override the default behaviour, redefine this function in
|
|
|
|
-the enter hook script.
|
|
|
|
+file.
|
|
|
|
+To override the default behaviour, redefine these function in the enter
|
|
|
|
+hook script. Before you start doing this, consider to implement own
|
|
|
|
+netconfig modules.
|
|
|
|
+
|
|
|
|
+.IR Note :
|
|
|
|
+Note, that since openSUSE 11.1, the modify_resolvconf script / mechanizm
|
|
|
|
+is obsoleted by netconfig and not shipped or supported any more.
|
|
|
|
+See the netconfig(8) manual page for more informations.
|
|
|
|
+
|
|
|
|
.PP
|
|
|
|
On after defining the make_resolv_conf function, the client script checks
|
|
|
|
for the presence of an executable
|
2009-12-16 16:52:02 +01:00
|
|
|
@@ -221,7 +253,7 @@
|
2008-09-13 00:24:42 +02:00
|
|
|
confusing.
|
|
|
|
.SH SEE ALSO
|
|
|
|
dhclient(8), dhcpd(8), dhcrelay(8), dhclient.conf(5) and
|
|
|
|
-dhclient.leases(5).
|
|
|
|
+dhclient.leases(5) and netconfig(8).
|
|
|
|
.SH AUTHOR
|
|
|
|
.B dhclient-script(8)
|
|
|
|
has been written for Internet Systems Consortium
|
|
|
|
--- client/scripts/linux
|
2009-12-16 16:52:02 +01:00
|
|
|
+++ client/scripts/linux 2009/05/04 10:01:50
|
|
|
|
@@ -22,25 +22,97 @@
|
2008-09-13 00:24:42 +02:00
|
|
|
# 4. TIMEOUT not tested. ping has a flag I don't know, and I'm suspicious
|
|
|
|
# of the $1 in its args.
|
|
|
|
|
|
|
|
+
|
|
|
|
+# Debugging:
|
|
|
|
+#
|
|
|
|
+# logs entire run of dhclient-script to /var/log/dhclient-script,
|
|
|
|
+# if DHCLIENT_DEBUG is set in sysconfig/network/dhcp
|
|
|
|
+#
|
2009-08-06 21:34:50 +02:00
|
|
|
+eval `grep "^DHCLIENT_DEBUG=" /etc/sysconfig/network/dhcp 2>/dev/null`
|
2008-09-13 00:24:42 +02:00
|
|
|
+if [ "$DHCLIENT_DEBUG" = yes ]; then
|
|
|
|
+ set -a # allexport
|
|
|
|
+ (
|
|
|
|
+ echo '****************'
|
|
|
|
+ echo "$0 $*"
|
|
|
|
+ date
|
|
|
|
+ echo '----------------'
|
|
|
|
+ set
|
|
|
|
+ echo '----------------'
|
|
|
|
+ ) >> /var/log/dhclient-script.log
|
|
|
|
+ exec 2>> /var/log/dhclient-script.log
|
|
|
|
+ set +a
|
|
|
|
+ set -x
|
|
|
|
+fi
|
|
|
|
+
|
|
|
|
+# netconfig makes all "additional" modifications as DNS or NTP
|
|
|
|
+use_netconfig() {
|
|
|
|
+ test -x /sbin/netconfig
|
|
|
|
+}
|
|
|
|
+netconfig_modify() {
|
2008-11-17 16:46:10 +01:00
|
|
|
+ if test -x /sbin/netconfig -a -n "$interface" ; then
|
2008-09-13 00:24:42 +02:00
|
|
|
+ {
|
|
|
|
+ echo "INTERFACE='$interface'"
|
|
|
|
+ for v in ${!new_*}; do
|
|
|
|
+ case $v in
|
|
|
|
+ (new_ip_address) k='IPADDR' ;;
|
|
|
|
+ (new_subnet_mask) k='NETMASK' ;;
|
|
|
|
+ (new_network_number) k='NETWORK' ;;
|
|
|
|
+ (new_broadcast_address) k='BROADCAST' ;;
|
2008-11-17 16:46:10 +01:00
|
|
|
+ (new_interface_mtu) k='MTU' ;;
|
2008-11-28 14:55:40 +01:00
|
|
|
+ # (new_static_routes) k='ROUTES' ;;
|
2008-09-13 00:24:42 +02:00
|
|
|
+ (new_routers) k='GATEWAYS' ;;
|
2008-11-17 16:46:10 +01:00
|
|
|
+ (new_host_name) k='HOSTNAME' ;;
|
2008-09-13 00:24:42 +02:00
|
|
|
+ (new_domain_name) k='DNSDOMAIN' ;;
|
|
|
|
+ (new_domain_name_servers) k='DNSSERVERS' ;;
|
|
|
|
+ (new_ntp_servers) k='NTPSERVERS' ;;
|
|
|
|
+ (new_nis_domain) k='NISDOMAIN' ;;
|
|
|
|
+ (new_nis_servers) k='NISSERVERS' ;;
|
2008-11-17 16:46:10 +01:00
|
|
|
+ (new_root_path) k='ROOTPATH' ;;
|
|
|
|
+ (new_dhcp_server_identifier)k='DHCPSID' ;;
|
|
|
|
+ (new_lpr_servers) k='LPRSERVER' ;;
|
|
|
|
+ (new_log_servers) k='LOGSERVER' ;;
|
|
|
|
+ (new_netbios_dd_server) k='NETBIOSDDSERVER' ;;
|
2008-09-13 00:24:42 +02:00
|
|
|
+ (new_netbios_name_servers) k='NETBIOSNAMESERVER' ;;
|
2008-11-17 16:46:10 +01:00
|
|
|
+ (new_netbios_node_type) k='NETBIOSNODETYPE' ;;
|
|
|
|
+ (new_netbios_scope) k='NETBIOSSCOPE' ;;
|
|
|
|
+ (*) k="dhclient_${v#new_}" ;;
|
2008-09-13 00:24:42 +02:00
|
|
|
+ esac
|
|
|
|
+ [ "k${k}" != k ] && echo "${k}='${!v}'"
|
|
|
|
+ done
|
|
|
|
+ } | /sbin/netconfig modify -s "dhclient3" -i "$interface"
|
|
|
|
+ fi
|
|
|
|
+}
|
|
|
|
+netconfig_remove() {
|
2008-11-17 16:46:10 +01:00
|
|
|
+ if test -x /sbin/netconfig -a -n "$interface" ; then
|
2008-09-13 00:24:42 +02:00
|
|
|
+ /sbin/netconfig remove -s "dhclient3" -i "$interface" </dev/null
|
|
|
|
+ fi
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
make_resolv_conf() {
|
|
|
|
+ ###
|
2009-12-16 16:52:02 +01:00
|
|
|
+ ### note: this function is never used
|
|
|
|
+ ### it creates /var/lib/dhcp/resolv.conf.dhclient.$interface only
|
2008-09-13 00:24:42 +02:00
|
|
|
+ ###
|
|
|
|
if [ x"$new_domain_name_servers" != x ]; then
|
|
|
|
- cat /dev/null > /etc/resolv.conf.dhclient
|
|
|
|
- chmod 644 /etc/resolv.conf.dhclient
|
2009-12-16 16:52:02 +01:00
|
|
|
+ cat /dev/null > /var/lib/dhcp/resolv.conf.dhclient.$interface
|
|
|
|
+ chmod 644 /var/lib/dhcp/resolv.conf.dhclient.$interface
|
2008-09-13 00:24:42 +02:00
|
|
|
if [ x"$new_domain_search" != x ]; then
|
|
|
|
- echo search $new_domain_search >> /etc/resolv.conf.dhclient
|
2009-12-16 16:52:02 +01:00
|
|
|
+ echo search $new_domain_search >> /var/lib/dhcp/resolv.conf.dhclient.$interface
|
2008-09-13 00:24:42 +02:00
|
|
|
elif [ x"$new_domain_name" != x ]; then
|
|
|
|
# Note that the DHCP 'Domain Name Option' is really just a domain
|
|
|
|
# name, and that this practice of using the domain name option as
|
|
|
|
# a search path is both nonstandard and deprecated.
|
|
|
|
- echo search $new_domain_name >> /etc/resolv.conf.dhclient
|
2009-12-16 16:52:02 +01:00
|
|
|
+ echo search $new_domain_name >> /var/lib/dhcp/resolv.conf.dhclient.$interface
|
2008-09-13 00:24:42 +02:00
|
|
|
fi
|
|
|
|
for nameserver in $new_domain_name_servers; do
|
|
|
|
- echo nameserver $nameserver >>/etc/resolv.conf.dhclient
|
2009-12-16 16:52:02 +01:00
|
|
|
+ echo nameserver $nameserver >> /var/lib/dhcp/resolv.conf.dhclient.$interface
|
2008-09-13 00:24:42 +02:00
|
|
|
done
|
2009-12-16 16:52:02 +01:00
|
|
|
-
|
2008-09-13 00:24:42 +02:00
|
|
|
- mv /etc/resolv.conf.dhclient /etc/resolv.conf
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
+restore_resolv_conf()
|
|
|
|
+{
|
2009-12-16 16:52:02 +01:00
|
|
|
+ rm -f /var/lib/dhcp/resolv.conf.dhclient.$interface
|
2008-09-13 00:24:42 +02:00
|
|
|
+}
|
|
|
|
|
|
|
|
# Must be used on exit. Invokes the local dhcp client exit hooks, if any.
|
|
|
|
exit_with_hooks() {
|
2009-12-16 16:52:02 +01:00
|
|
|
@@ -83,6 +155,10 @@
|
|
|
|
if [ x$alias_subnet_mask != x ]; then
|
2009-01-22 13:08:36 +01:00
|
|
|
alias_subnet_arg="netmask $alias_subnet_mask"
|
|
|
|
fi
|
2009-12-16 16:52:02 +01:00
|
|
|
+if [ $(($new_interface_mtu)) -lt 576 ] ; then
|
|
|
|
+ # 68 is the minimal legal value, but 576 the real life minimum
|
|
|
|
+ unset new_interface_mtu
|
|
|
|
+fi
|
|
|
|
|
|
|
|
if [ x$reason = xMEDIUM ]; then
|
|
|
|
# Linux doesn't do mediums (ok, ok, media).
|
|
|
|
@@ -97,7 +173,7 @@
|
|
|
|
if [ $relmajor -lt 2 ] || ( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] )
|
|
|
|
then
|
|
|
|
ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 \
|
|
|
|
- broadcast 255.255.255.255 up
|
|
|
|
+ broadcast 255.255.255.255 up
|
|
|
|
# Add route to make broadcast work. Do not omit netmask.
|
|
|
|
route add default dev $interface netmask 0.0.0.0
|
|
|
|
else
|
|
|
|
@@ -116,47 +192,117 @@
|
2008-09-13 00:24:42 +02:00
|
|
|
|
|
|
|
if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
|
|
|
|
[ x$reason = xREBIND ] || [ x$reason = xREBOOT ]; then
|
|
|
|
- current_hostname=`hostname`
|
|
|
|
- if [ x$current_hostname = x ] || \
|
|
|
|
- [ x$current_hostname = x$old_host_name ]; then
|
2009-12-16 16:52:02 +01:00
|
|
|
- if [ x$current_hostname = x ] || \
|
|
|
|
- [ x$new_host_name != x$old_host_name ]; then
|
|
|
|
- hostname $new_host_name
|
2008-09-13 00:24:42 +02:00
|
|
|
- fi
|
|
|
|
- fi
|
2009-12-16 16:52:02 +01:00
|
|
|
-
|
2008-09-13 00:24:42 +02:00
|
|
|
if [ x$old_ip_address != x ] && [ x$alias_ip_address != x ] && \
|
2009-12-16 16:52:02 +01:00
|
|
|
- [ x$alias_ip_address != x$old_ip_address ]; then
|
|
|
|
+ [ x$alias_ip_address != x$old_ip_address ]; then
|
|
|
|
# Possible new alias. Remove old alias.
|
|
|
|
ifconfig $interface:0- inet 0
|
|
|
|
fi
|
2008-09-13 00:24:42 +02:00
|
|
|
if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]; then
|
|
|
|
# IP address changed. Bringing down the interface will delete all routes,
|
|
|
|
# and clear the ARP cache.
|
|
|
|
- ifconfig $interface inet 0 down
|
|
|
|
+ ifconfig $interface inet 0
|
|
|
|
|
|
|
|
fi
|
|
|
|
if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
|
2009-12-16 16:52:02 +01:00
|
|
|
[ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
|
|
|
|
|
|
|
|
ifconfig $interface inet $new_ip_address $new_subnet_arg \
|
|
|
|
- $new_broadcast_arg
|
|
|
|
+ $new_broadcast_arg \
|
|
|
|
+ ${new_interface_mtu:+mtu "$new_interface_mtu"}
|
|
|
|
# Add a network route to the computed network address.
|
|
|
|
if [ $relmajor -lt 2 ] || \
|
|
|
|
- ( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] ); then
|
|
|
|
+ ( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] ); then
|
2008-09-13 00:24:42 +02:00
|
|
|
route add -net $new_network_number $new_subnet_arg dev $interface
|
|
|
|
fi
|
2008-11-17 16:46:10 +01:00
|
|
|
- for router in $new_routers; do
|
2009-12-16 16:52:02 +01:00
|
|
|
- route add default gw $router
|
2008-11-17 16:46:10 +01:00
|
|
|
- done
|
|
|
|
+
|
2009-12-16 16:52:02 +01:00
|
|
|
+ if test -f /etc/sysconfig/network/ifcfg-${interface} -o \
|
|
|
|
+ -f /dev/shm/sysconfig/if-${interface} ;
|
|
|
|
+ then
|
|
|
|
+ if grep -qs '^primary=yes' /dev/shm/sysconfig/if-${interface} 2>/dev/null ;
|
|
|
|
+ then
|
|
|
|
+ eval `grep --no-filename '^[[:space:]]*DHCLIENT_SET_DEFAULT_ROUTE=' \
|
|
|
|
+ /etc/sysconfig/network/dhcp
|
|
|
|
+ /etc/sysconfig/network/ifcfg-${interface} 2>/dev/null`
|
|
|
|
+ else
|
|
|
|
+ eval `grep --no-filename '^[[:space:]]*DHCLIENT_SET_DEFAULT_ROUTE=' \
|
|
|
|
+ /etc/sysconfig/network/ifcfg-${interface} 2>/dev/null`
|
|
|
|
+ fi
|
|
|
|
+ else
|
|
|
|
+ eval `grep --no-filename '^[[:space:]]*DHCLIENT_SET_DEFAULT_ROUTE=' \
|
|
|
|
+ /etc/sysconfig/network/dhcp 2>/dev/null`
|
|
|
|
+ fi
|
|
|
|
+ if [ "$DHCLIENT_SET_DEFAULT_ROUTE" = yes ] ; then
|
|
|
|
+ for router in $new_routers; do
|
|
|
|
+ err=`route add default gw $router 2>&1` && break || \
|
|
|
|
+ case "$err" in
|
|
|
|
+ SIOCADDRT:*)
|
|
|
|
+ # The gateway seems to be not reachable via local network
|
|
|
|
+ # route (implicitely created by ifconfig based on the IP
|
|
|
|
+ # an netmask provided by dhcp).
|
|
|
|
+ # Check this, set an explicit host route to the gateway
|
|
|
|
+ # over the current interface and try again (bnc#266215).
|
|
|
|
+ matches=$(test -x /sbin/ip && \
|
|
|
|
+ /sbin/ip -f inet -o route list match $router | \
|
|
|
|
+ grep -v ^default | grep -c -v "^$" 2>/dev/null)
|
|
|
|
+ if test -n "$matches" -a $(($matches)) -eq 0 ; then
|
|
|
|
+ route add -host $router dev $interface && \
|
|
|
|
+ route add default gw $router && break
|
|
|
|
+ fi
|
|
|
|
+ ;;
|
|
|
|
+ esac
|
|
|
|
+ done
|
|
|
|
+ fi
|
2008-09-13 00:24:42 +02:00
|
|
|
fi
|
2009-08-06 21:34:50 +02:00
|
|
|
+
|
2008-09-13 00:24:42 +02:00
|
|
|
if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ];
|
2008-11-17 16:46:10 +01:00
|
|
|
then
|
2009-08-06 21:34:50 +02:00
|
|
|
ifconfig $interface:0- inet 0
|
2008-09-13 00:24:42 +02:00
|
|
|
ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
|
|
|
|
route add -host $alias_ip_address $interface:0
|
|
|
|
fi
|
|
|
|
- make_resolv_conf
|
2009-08-06 21:34:50 +02:00
|
|
|
+
|
2008-09-13 00:24:42 +02:00
|
|
|
+ if use_netconfig ; then
|
|
|
|
+ netconfig_modify
|
|
|
|
+ else
|
|
|
|
+ make_resolv_conf
|
|
|
|
+ fi
|
2009-08-06 21:34:50 +02:00
|
|
|
+
|
2009-12-16 16:52:02 +01:00
|
|
|
+ if test -f /etc/sysconfig/network/ifcfg-${interface} -o \
|
|
|
|
+ -f /dev/shm/sysconfig/if-${interface} ;
|
|
|
|
+ then
|
|
|
|
+ if grep -qs '^primary=yes' /dev/shm/sysconfig/if-${interface} 2>/dev/null ;
|
|
|
|
+ then
|
|
|
|
+ eval `grep --no-filename "^[[:space:]]*DHCLIENT_SET_HOSTNAME=" \
|
|
|
|
+ /etc/sysconfig/network/dhcp
|
|
|
|
+ /etc/sysconfig/network/ifcfg-${interface} 2>/dev/null`
|
|
|
|
+ else
|
|
|
|
+ eval `grep --no-filename "^[[:space:]]*DHCLIENT_SET_HOSTNAME=" \
|
|
|
|
+ /etc/sysconfig/network/ifcfg-${interface} 2>/dev/null`
|
|
|
|
+ fi
|
|
|
|
+ else
|
|
|
|
+ eval `grep --no-filename "^[[:space:]]*DHCLIENT_SET_HOSTNAME=" \
|
|
|
|
+ /etc/sysconfig/network/dhcp 2>/dev/null`
|
|
|
|
+ fi
|
|
|
|
+ if [ "$DHCLIENT_SET_HOSTNAME" = yes ] ; then
|
|
|
|
+ current_hostname=`hostname`
|
|
|
|
+ if [ "x${current_hostname%%.*}" = x ] || \
|
|
|
|
+ [ "x${current_hostname%%.*}" != "x${new_host_name%%.*}" ]; then
|
|
|
|
+
|
|
|
|
+ if [ "x${new_host_name%%.*}" != x ]; then
|
|
|
|
+ hostname "${new_host_name%%.*}"
|
|
|
|
+ else
|
|
|
|
+ if [ -x /usr/bin/host ] ; then
|
|
|
|
+ if out=`host -W 2 "$new_ip_address" 2>/dev/null` ; then
|
|
|
|
+ _hostname="`echo "$out" | sed 's:^.* ::; s:\..*::'`"
|
|
|
|
+ if [ "x${_hostname}" != x ]; then
|
|
|
|
+ hostname "${_hostname}"
|
|
|
|
+ fi
|
|
|
|
+ fi
|
|
|
|
+ fi
|
|
|
|
+ fi
|
|
|
|
+ fi
|
|
|
|
+ fi
|
2009-08-06 21:34:50 +02:00
|
|
|
+
|
2008-09-13 00:24:42 +02:00
|
|
|
exit_with_hooks 0
|
|
|
|
fi
|
|
|
|
|
2009-12-16 16:52:02 +01:00
|
|
|
@@ -168,7 +314,7 @@
|
2008-09-13 00:24:42 +02:00
|
|
|
fi
|
|
|
|
if [ x$old_ip_address != x ]; then
|
|
|
|
# Shut down interface, which will delete routes and clear arp cache.
|
|
|
|
- ifconfig $interface inet 0 down
|
|
|
|
+ ifconfig $interface inet 0
|
|
|
|
fi
|
|
|
|
if [ x$alias_ip_address != x ]; then
|
|
|
|
ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
|
2009-12-16 16:52:02 +01:00
|
|
|
@@ -182,27 +328,37 @@
|
|
|
|
ifconfig $interface:0- inet 0
|
2008-09-13 00:24:42 +02:00
|
|
|
fi
|
|
|
|
ifconfig $interface inet $new_ip_address $new_subnet_arg \
|
2009-12-16 16:52:02 +01:00
|
|
|
- $new_broadcast_arg
|
|
|
|
+ $new_broadcast_arg
|
|
|
|
set $new_routers
|
|
|
|
############## what is -w in ping?
|
2008-09-13 00:24:42 +02:00
|
|
|
if ping -q -c 1 $1; then
|
|
|
|
if [ x$new_ip_address != x$alias_ip_address ] && \
|
2009-12-16 16:52:02 +01:00
|
|
|
- [ x$alias_ip_address != x ]; then
|
|
|
|
+ [ x$alias_ip_address != x ]; then
|
|
|
|
ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
|
|
|
|
route add -host $alias_ip_address dev $interface:0
|
|
|
|
fi
|
|
|
|
if [ $relmajor -lt 2 ] || \
|
|
|
|
- ( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] ); then
|
|
|
|
+ ( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] ); then
|
2008-09-13 00:24:42 +02:00
|
|
|
route add -net $new_network_number
|
|
|
|
fi
|
2009-12-16 16:52:02 +01:00
|
|
|
for router in $new_routers; do
|
|
|
|
route add default gw $router
|
|
|
|
done
|
2008-09-13 00:24:42 +02:00
|
|
|
- make_resolv_conf
|
|
|
|
+ if use_netconfig ; then
|
|
|
|
+ netconfig_modify
|
|
|
|
+ else
|
|
|
|
+ make_resolv_conf
|
|
|
|
+ fi
|
|
|
|
exit_with_hooks 0
|
|
|
|
fi
|
|
|
|
- ifconfig $interface inet 0 down
|
|
|
|
+ ifconfig $interface inet 0
|
|
|
|
exit_with_hooks 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
+if use_netconfig ; then
|
|
|
|
+ netconfig_remove
|
|
|
|
+else
|
|
|
|
+ restore_resolv_conf
|
|
|
|
+fi
|
|
|
|
+
|
|
|
|
exit_with_hooks 0
|