mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-09-02 15:25:48 +00:00
Use make_resolv_conf as documented.
This commit is contained in:
@@ -123,10 +123,7 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
|
|||||||
ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
|
ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
|
||||||
route add $alias_ip_address 127.0.0.1
|
route add $alias_ip_address 127.0.0.1
|
||||||
fi
|
fi
|
||||||
echo search $new_domain_name >/etc/resolv.conf
|
make_resolv_conf
|
||||||
for nameserver in $new_domain_name_servers; do
|
|
||||||
echo nameserver $nameserver >>/etc/resolv.conf
|
|
||||||
done
|
|
||||||
exit_with_hooks 0
|
exit_with_hooks 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -183,14 +180,7 @@ if [ x$reason = xTIMEOUT ]; then
|
|||||||
route add $0 $1
|
route add $0 $1
|
||||||
shift; shift
|
shift; shift
|
||||||
done
|
done
|
||||||
echo search $new_domain_name >/etc/resolv.conf.std
|
make_resolv_conf
|
||||||
for nameserver in $new_domain_name_servers; do
|
|
||||||
echo nameserver $nameserver >>/etc/resolv.conf.std
|
|
||||||
done
|
|
||||||
if [ -f /etc/resolv.conf ]; then
|
|
||||||
rm -f /etc/resolv.conf
|
|
||||||
fi
|
|
||||||
mv /etc/resolv.conf.std /etc/resolv.conf
|
|
||||||
exit_with_hooks 0
|
exit_with_hooks 0
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@@ -122,10 +122,7 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
|
|||||||
ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
|
ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
|
||||||
route add $alias_ip_address 127.0.0.1
|
route add $alias_ip_address 127.0.0.1
|
||||||
fi
|
fi
|
||||||
echo search $new_domain_name >/etc/resolv.conf
|
make_resolv_conf
|
||||||
for nameserver in $new_domain_name_servers; do
|
|
||||||
echo nameserver $nameserver >>/etc/resolv.conf
|
|
||||||
done
|
|
||||||
exit_with_hooks 0
|
exit_with_hooks 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -182,14 +179,7 @@ if [ x$reason = xTIMEOUT ]; then
|
|||||||
route add $0 $1
|
route add $0 $1
|
||||||
shift; shift
|
shift; shift
|
||||||
done
|
done
|
||||||
echo search $new_domain_name >/etc/resolv.conf.std
|
make_resolv_conf
|
||||||
for nameserver in $new_domain_name_servers; do
|
|
||||||
echo nameserver $nameserver >>/etc/resolv.conf.std
|
|
||||||
done
|
|
||||||
if [ -f /etc/resolv.conf ]; then
|
|
||||||
rm -f /etc/resolv.conf
|
|
||||||
fi
|
|
||||||
mv /etc/resolv.conf.std /etc/resolv.conf
|
|
||||||
exit_with_hooks 0
|
exit_with_hooks 0
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@@ -22,6 +22,13 @@
|
|||||||
# 4. TIMEOUT not tested. ping has a flag I don't know, and I'm suspicious
|
# 4. TIMEOUT not tested. ping has a flag I don't know, and I'm suspicious
|
||||||
# of the $1 in its args.
|
# of the $1 in its args.
|
||||||
|
|
||||||
|
function make_resolv_conf() {
|
||||||
|
echo search $new_domain_name >/etc/resolv.conf
|
||||||
|
for nameserver in $new_domain_name_servers; do
|
||||||
|
echo nameserver $nameserver >>/etc/resolv.conf
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
# Must be used on exit. Invokes the local dhcp client exit hooks, if any.
|
# Must be used on exit. Invokes the local dhcp client exit hooks, if any.
|
||||||
function exit_with_hooks() {
|
function exit_with_hooks() {
|
||||||
exit_status=$1
|
exit_status=$1
|
||||||
@@ -136,10 +143,7 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
|
|||||||
ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
|
ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
|
||||||
route add -host $alias_ip_address $interface:0
|
route add -host $alias_ip_address $interface:0
|
||||||
fi
|
fi
|
||||||
echo search $new_domain_name >/etc/resolv.conf
|
make_resolv_conf
|
||||||
for nameserver in $new_domain_name_servers; do
|
|
||||||
echo nameserver $nameserver >>/etc/resolv.conf
|
|
||||||
done
|
|
||||||
exit_with_hooks 0
|
exit_with_hooks 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -180,14 +184,7 @@ if [ x$reason = xTIMEOUT ]; then
|
|||||||
for router in $new_routers; do
|
for router in $new_routers; do
|
||||||
route add default gw $router
|
route add default gw $router
|
||||||
done
|
done
|
||||||
echo search $new_domain_name >/etc/resolv.conf.std
|
make_resolv_conf
|
||||||
for nameserver in $new_domain_name_servers; do
|
|
||||||
echo nameserver $nameserver >>/etc/resolv.conf.std
|
|
||||||
done
|
|
||||||
if [ -f /etc/resolv.conf ]; then
|
|
||||||
rm -f /etc/resolv.conf
|
|
||||||
ln /etc/resolv.conf.std /etc/resolv.conf
|
|
||||||
fi
|
|
||||||
exit_with_hooks 0
|
exit_with_hooks 0
|
||||||
fi
|
fi
|
||||||
ifconfig $interface inet down
|
ifconfig $interface inet down
|
||||||
|
@@ -123,10 +123,7 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
|
|||||||
ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
|
ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
|
||||||
route add $alias_ip_address 127.0.0.1
|
route add $alias_ip_address 127.0.0.1
|
||||||
fi
|
fi
|
||||||
echo search $new_domain_name >/etc/resolv.conf
|
make_resolv_conf
|
||||||
for nameserver in $new_domain_name_servers; do
|
|
||||||
echo nameserver $nameserver >>/etc/resolv.conf
|
|
||||||
done
|
|
||||||
exit_with_hooks 0
|
exit_with_hooks 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -183,14 +180,7 @@ if [ x$reason = xTIMEOUT ]; then
|
|||||||
route add $0 $1
|
route add $0 $1
|
||||||
shift; shift
|
shift; shift
|
||||||
done
|
done
|
||||||
echo search $new_domain_name >/etc/resolv.conf.std
|
make_resolv_conf
|
||||||
for nameserver in $new_domain_name_servers; do
|
|
||||||
echo nameserver $nameserver >>/etc/resolv.conf.std
|
|
||||||
done
|
|
||||||
if [ -f /etc/resolv.conf ]; then
|
|
||||||
rm -f /etc/resolv.conf
|
|
||||||
fi
|
|
||||||
mv /etc/resolv.conf.std /etc/resolv.conf
|
|
||||||
exit_with_hooks 0
|
exit_with_hooks 0
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@@ -116,10 +116,7 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
|
|||||||
$ifconfig ${interface}:1 inet $alias_ip_address $alias_subnet_arg
|
$ifconfig ${interface}:1 inet $alias_ip_address $alias_subnet_arg
|
||||||
route add $alias_ip_address 127.0.0.1 1
|
route add $alias_ip_address 127.0.0.1 1
|
||||||
fi
|
fi
|
||||||
echo search $new_domain_name >/etc/resolv.conf
|
make_resolv_conf
|
||||||
for nameserver in $new_domain_name_servers; do
|
|
||||||
echo nameserver $nameserver >>/etc/resolv.conf
|
|
||||||
done
|
|
||||||
exit_with_hooks 0
|
exit_with_hooks 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -161,14 +158,7 @@ if [ x$reason = xTIMEOUT ]; then
|
|||||||
for router in $new_routers; do
|
for router in $new_routers; do
|
||||||
route add default $router 1 >/dev/null 2>&1
|
route add default $router 1 >/dev/null 2>&1
|
||||||
done
|
done
|
||||||
echo search $new_domain_name >/etc/resolv.conf.std
|
make_resolv_conf
|
||||||
for nameserver in $new_domain_name_servers; do
|
|
||||||
echo nameserver $nameserver >>/etc/resolv.conf.std
|
|
||||||
done
|
|
||||||
if [ -f /etc/resolv.conf ]; then
|
|
||||||
rm -f /etc/resolv.conf
|
|
||||||
ln /etc/resolv.conf.std /etc/resolv.conf
|
|
||||||
fi
|
|
||||||
exit_with_hooks 0
|
exit_with_hooks 0
|
||||||
fi
|
fi
|
||||||
$ifconfig $interface inet 0 down
|
$ifconfig $interface inet 0 down
|
||||||
|
Reference in New Issue
Block a user