mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 22:50:49 +00:00
16bfb94736
svn path=/nixpkgs/trunk/; revision=4078
167 lines
6.4 KiB
Diff
167 lines
6.4 KiB
Diff
diff -ruN dhcp-3.0.3/client/scripts/linux dhcp-3.0.3.new/client/scripts/linux
|
|
--- dhcp-3.0.3/client/scripts/linux 2002-11-15 02:09:09.000000000 +0100
|
|
+++ dhcp-3.0.3.new/client/scripts/linux 2005-10-12 22:12:20.000000000 +0200
|
|
@@ -25,7 +25,7 @@
|
|
make_resolv_conf() {
|
|
if [ "x$new_domain_name" != x ] && [ x"$new_domain_name_servers" != x ]; then
|
|
echo search $new_domain_name >/etc/resolv.conf
|
|
- chmod 644 /etc/resolv.conf
|
|
+ @coreutils@/bin/chmod 644 /etc/resolv.conf
|
|
for nameserver in $new_domain_name_servers; do
|
|
echo nameserver $nameserver >>/etc/resolv.conf
|
|
done
|
|
@@ -53,10 +53,10 @@
|
|
fi
|
|
fi
|
|
|
|
-release=`uname -r`
|
|
-release=`expr $release : '\(.*\)\..*'`
|
|
-relminor=`echo $release |sed -e 's/[0-9]*\.\([0-9][0-9]*\)\(\..*\)*$/\1/'`
|
|
-relmajor=`echo $release |sed -e 's/\([0-9][0-9]*\)\..*$/\1/'`
|
|
+release=`@coreutils@/bin/uname -r`
|
|
+release=`@coreutils@/bin/expr $release : '\(.*\)\..*'`
|
|
+relminor=`echo $release |@gnused@/bin/sed -e 's/[0-9]*\.\([0-9][0-9]*\)\(\..*\)*$/\1/'`
|
|
+relmajor=`echo $release |@gnused@/bin/sed -e 's/\([0-9][0-9]*\)\..*$/\1/'`
|
|
|
|
if [ x$new_broadcast_address != x ]; then
|
|
new_broadcast_arg="broadcast $new_broadcast_address"
|
|
@@ -82,20 +82,20 @@
|
|
if [ x$reason = xPREINIT ]; then
|
|
if [ x$alias_ip_address != x ]; then
|
|
# Bring down alias interface. Its routes will disappear too.
|
|
- ifconfig $interface:0- inet 0
|
|
+ @nettools@/sbin/ifconfig $interface:0- inet 0
|
|
fi
|
|
if [ $relmajor -lt 2 ] || ( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] )
|
|
then
|
|
- ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 \
|
|
+ @nettools@/sbin/ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 \
|
|
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
|
|
+ @nettools@/sbin/route add default dev $interface netmask 0.0.0.0
|
|
else
|
|
- ifconfig $interface 0 up
|
|
+ @nettools@/sbin/ifconfig $interface 0 up
|
|
fi
|
|
|
|
# We need to give the kernel some time to get the interface up.
|
|
- sleep 1
|
|
+ @coreutils@/bin/sleep 1
|
|
|
|
exit_with_hooks 0
|
|
fi
|
|
@@ -106,45 +106,45 @@
|
|
|
|
if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
|
|
[ x$reason = xREBIND ] || [ x$reason = xREBOOT ]; then
|
|
- current_hostname=`hostname`
|
|
+ current_hostname=`@nettools@/bin/hostname`
|
|
if [ x$current_hostname = x ] || \
|
|
[ x$current_hostname = x$old_host_name ]; then
|
|
if [ x$current_hostname = x ] || \
|
|
[ x$new_host_name != x$old_host_name ]; then
|
|
- hostname $new_host_name
|
|
+ @nettools@/bin/hostname $new_host_name
|
|
fi
|
|
fi
|
|
|
|
if [ x$old_ip_address != x ] && [ x$alias_ip_address != x ] && \
|
|
[ x$alias_ip_address != x$old_ip_address ]; then
|
|
# Possible new alias. Remove old alias.
|
|
- ifconfig $interface:0- inet 0
|
|
+ @nettools@/sbin/ifconfig $interface:0- inet 0
|
|
fi
|
|
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
|
|
+ @nettools@/sbin/ifconfig $interface inet 0 down
|
|
|
|
fi
|
|
if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
|
|
[ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
|
|
|
|
- ifconfig $interface inet $new_ip_address $new_subnet_arg \
|
|
+ @nettools@/sbin/ifconfig $interface inet $new_ip_address $new_subnet_arg \
|
|
$new_broadcast_arg
|
|
# Add a network route to the computed network address.
|
|
if [ $relmajor -lt 2 ] || \
|
|
( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] ); then
|
|
- route add -net $new_network_number $new_subnet_arg dev $interface
|
|
+ @nettools@/sbin/route add -net $new_network_number $new_subnet_arg dev $interface
|
|
fi
|
|
for router in $new_routers; do
|
|
- route add default gw $router
|
|
+ @nettools@/sbin/route add default gw $router
|
|
done
|
|
fi
|
|
if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ];
|
|
then
|
|
- ifconfig $interface:0- inet 0
|
|
- ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
|
|
- route add -host $alias_ip_address $interface:0
|
|
+ @nettools@/sbin/ifconfig $interface:0- inet 0
|
|
+ @nettools@/sbin/ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
|
|
+ @nettools@/sbin/route add -host $alias_ip_address $interface:0
|
|
fi
|
|
make_resolv_conf
|
|
exit_with_hooks 0
|
|
@@ -154,44 +154,44 @@
|
|
|| [ x$reason = xSTOP ]; then
|
|
if [ x$alias_ip_address != x ]; then
|
|
# Turn off alias interface.
|
|
- ifconfig $interface:0- inet 0
|
|
+ @nettools@/sbin/ifconfig $interface:0- inet 0
|
|
fi
|
|
if [ x$old_ip_address != x ]; then
|
|
# Shut down interface, which will delete routes and clear arp cache.
|
|
- ifconfig $interface inet 0 down
|
|
+ @nettools@/sbin/ifconfig $interface inet 0 down
|
|
fi
|
|
if [ x$alias_ip_address != x ]; then
|
|
- ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
|
|
- route add -host $alias_ip_address $interface:0
|
|
+ @nettools@/sbin/ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
|
|
+ @nettools@/sbin/route add -host $alias_ip_address $interface:0
|
|
fi
|
|
exit_with_hooks 0
|
|
fi
|
|
|
|
if [ x$reason = xTIMEOUT ]; then
|
|
if [ x$alias_ip_address != x ]; then
|
|
- ifconfig $interface:0- inet 0
|
|
+ @nettools@/sbin/ifconfig $interface:0- inet 0
|
|
fi
|
|
- ifconfig $interface inet $new_ip_address $new_subnet_arg \
|
|
+ @nettools@/sbin/ifconfig $interface inet $new_ip_address $new_subnet_arg \
|
|
$new_broadcast_arg
|
|
set $new_routers
|
|
############## what is -w in ping?
|
|
- if ping -q -c 1 $1; then
|
|
+ if @iputils@/bin/ping -q -c 1 $1; then
|
|
if [ x$new_ip_address != x$alias_ip_address ] && \
|
|
[ 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
|
|
+ @nettools@/sbin/ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
|
|
+ @nettools@/sbin/route add -host $alias_ip_address dev $interface:0
|
|
fi
|
|
if [ $relmajor -lt 2 ] || \
|
|
( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] ); then
|
|
- route add -net $new_network_number
|
|
+ @nettools@/sbin/route add -net $new_network_number
|
|
fi
|
|
for router in $new_routers; do
|
|
- route add default gw $router
|
|
+ @nettools@/sbin/route add default gw $router
|
|
done
|
|
make_resolv_conf
|
|
exit_with_hooks 0
|
|
fi
|
|
- ifconfig $interface inet 0 down
|
|
+ @nettools@/sbin/ifconfig $interface inet 0 down
|
|
exit_with_hooks 1
|
|
fi
|
|
|