Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/dhcp/clientscript - Don't assume that /usr is avail...



details:   https://anonhg.NetBSD.org/src/rev/42abd14a13d9
branches:  trunk
changeset: 525353:42abd14a13d9
user:      enami <enami%NetBSD.org@localhost>
date:      Wed Apr 10 10:11:41 2002 +0000

description:
- Don't assume that /usr is available.  Fixes (one of?) ``fgrep: not found''.
- Don't append ``dot'' when restoring resovl.conf.

diffstat:

 usr.sbin/dhcp/clientscript/dhclient-script |  26 +++++++++++++++++---------
 1 files changed, 17 insertions(+), 9 deletions(-)

diffs (49 lines):

diff -r 779c9cebe592 -r 42abd14a13d9 usr.sbin/dhcp/clientscript/dhclient-script
--- a/usr.sbin/dhcp/clientscript/dhclient-script        Wed Apr 10 10:09:31 2002 +0000
+++ b/usr.sbin/dhcp/clientscript/dhclient-script        Wed Apr 10 10:11:41 2002 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: dhclient-script,v 1.3 2002/04/02 19:16:59 christos Exp $
+# $NetBSD: dhclient-script,v 1.4 2002/04/10 10:11:41 enami Exp $
 
 ENTERHOOKS=/etc/dhclient-enter-hooks
 EXITHOOKS=/etc/dhclient-exit-hooks
@@ -12,10 +12,15 @@
             \( ! -z "$new_domain_name_servers" \) ]; then
                if [ -f $RESOLV ]
                then
-                       if ! fgrep -q "$SIGNATURE" $RESOLV
-                       then
-                               mv $RESOLV $RESOLV.save
-                       fi
+                       while read line; do
+                               case $line in
+                               "$SIGNATURE"*)
+                                       ;;
+                               *)
+                                       mv $RESOLV $RESOLV.save;;
+                               esac
+                               break
+                       done < $RESOLV
                fi
                echo "$SIGNATURE$(date)" > $RESOLV
                if [ ! -z "$new_domain_name" ]
@@ -31,10 +36,13 @@
 restore_resolv_conf() {
        if [ -f $RESOLV.save -a -f $RESOLV ]
        then
-               if fgrep -q "$SIGNATURE" $RESOLV
-               then
-                       mv $RESOLV.save $RESOLV.
-               fi
+               while read line; do
+                       case $line in
+                       "$SIGNATURE"*)
+                               mv $RESOLV.save $RESOLV;;
+                       esac
+                       break
+               done < $RESOLV
        fi
 }
 



Home | Main Index | Thread Index | Old Index