Source-Changes-HG archive

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

[src/trunk]: src/share/sushi/network/interfaces/interface Clean up the output...



details:   https://anonhg.NetBSD.org/src/rev/6b0c9ec19f19
branches:  trunk
changeset: 513474:6b0c9ec19f19
user:      garbled <garbled%NetBSD.org@localhost>
date:      Wed Aug 01 09:10:57 2001 +0000

description:
Clean up the output a bit, and break the inet and inet6 commands into two
separate commands on the now and both settings.  Otherwise ifconfig thinks
you are setting up a point2point link.

diffstat:

 share/sushi/network/interfaces/interface/script |  24 +++++++++++-------------
 1 files changed, 11 insertions(+), 13 deletions(-)

diffs (56 lines):

diff -r cd15641214e9 -r 6b0c9ec19f19 share/sushi/network/interfaces/interface/script
--- a/share/sushi/network/interfaces/interface/script   Wed Aug 01 09:08:55 2001 +0000
+++ b/share/sushi/network/interfaces/interface/script   Wed Aug 01 09:10:57 2001 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: script,v 1.2 2001/07/12 19:11:43 garbled Exp $
+# $NetBSD: script,v 1.3 2001/08/01 09:10:57 garbled Exp $
 
 IFFILE="/etc/ifconfig.$1"
 MTU=`echo "$12" | sed -e 's/^0*//'`
@@ -57,18 +57,12 @@
        unset $IFS
        echo
        echo "$IFCON"
+       echo ""
 fi
 
-if [ "$2" = "both" ]; then
-       (while read args; do
-               if [ -n "`eval echo '$args'`" ]; then
-                       ifconfig $1 $args
-               fi
-       done) < $IFFILE
-fi
-
-if [ "$2" = "now" ]; then
+if [ "$2" = "now" -o "$2" = "both" ]; then
        NET=`echo -n "$1 inet $3"`
+       NET2=`echo -n "$1"`
        if [ ! -z $4 ]; then
                NET=`echo -n " $NET netmask $4"`
        fi
@@ -82,10 +76,10 @@
                NET=`echo -n " $NET mediaopt $7"`
        fi
        if [ ! -z $8 ]; then
-               NET=`echo -n " $NET inet6 $8"`
+               NET2=`echo -n " $NET2 inet6 $8"`
        fi
        if [ ! -z $9 ]; then
-               NET=`echo -n " $NET prefixlen $9"`
+               NET2=`echo -n " $NET2 prefixlen $9"`
        fi
        if [ ! -z $10 ]; then
                NET=`echo -n " $NET nwid "\""$10"\"""`
@@ -104,5 +98,9 @@
                NET=`echo -n " $NET metric $13"`
        fi
        ifconfig $NET
-       echo "Modifications have been made to $1"
+       if [ "$NET2" != "$1" ]; then
+               ifconfig $NET2
+       fi
+       echo "Modifications have been made to $1:"
+       ifconfig $1
 fi



Home | Main Index | Thread Index | Old Index