dhcp/dhcp-4.0.0-dhclient-script-chk4lock.patch

26 lines
1.1 KiB
Diff
Raw Normal View History

diff -Nru dhcp-4.0.0.orig/client/scripts/linux dhcp-4.0.0/client/scripts/linux
--- dhcp-4.0.0.orig/client/scripts/linux 2007-06-07 00:57:32.000000000 +0200
+++ dhcp-4.0.0/client/scripts/linux 2008-07-03 10:12:37.000000000 +0200
@@ -27,7 +27,11 @@
make_resolv_conf() {
if [ x"$new_domain_name_servers" != x ]; then
- cat /dev/null > /etc/resolv.conf.dhclient
+ LOCKLINE=`grep -m1 "^; lock [0-9]\+" /etc/resolv.conf 2>/dev/null`
+ if [ "$LOCKLINE" ] ; then
+ [ -e /proc/${LOCKLINE##; lock } ] && return
+ fi
+ echo "; generated by /sbin/dhclient-script" > /etc/resolv.conf.dhclient
chmod 644 /etc/resolv.conf.dhclient
if [ x"$new_domain_search" != x ]; then
echo search $new_domain_search >> /etc/resolv.conf.dhclient
@@ -43,7 +47,7 @@
mv /etc/resolv.conf.dhclient /etc/resolv.conf
elif [ "x${new_dhcp6_name_servers}" != x ] ; then
- cat /dev/null > /etc/resolv.conf.dhclient6
+ echo "; generated by /sbin/dhclient-script" > /etc/resolv.conf.dhclient6
chmod 644 /etc/resolv.conf.dhclient6
if [ "x${new_dhcp6_domain_search}" != x ] ; then