summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2002-02-23 01:55:24 +0000
committerderaadt <deraadt@openbsd.org>2002-02-23 01:55:24 +0000
commitf5319bdc797479f0f949c1e5b412f232435d78ff (patch)
tree66f51152ac9f3790a495716e0d09a416bbb95151
parentno more need to explicitly specify regress: _SUBDIRUSE targets anymore. (diff)
downloadwireguard-openbsd-f5319bdc797479f0f949c1e5b412f232435d78ff.tar.xz
wireguard-openbsd-f5319bdc797479f0f949c1e5b412f232435d78ff.zip
re-add support for $if expansion; hamajima@nagoya.ydc.co.jp
-rw-r--r--etc/netstart27
1 files changed, 14 insertions, 13 deletions
diff --git a/etc/netstart b/etc/netstart
index fba839bf96c..9ca4beb6d51 100644
--- a/etc/netstart
+++ b/etc/netstart
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# $OpenBSD: netstart,v 1.83 2002/02/21 02:32:01 miod Exp $
+# $OpenBSD: netstart,v 1.84 2002/02/23 01:55:24 deraadt Exp $
# Returns true if $1 contains only alphanumerics
isalphanumeric() {
@@ -18,13 +18,14 @@ isalphanumeric() {
# Start the $1 interface
ifstart() {
+ if=$1
# Interface names must be alphanumeric only. We check to avoid
# configuring backup or temp files, and to catch the "*" case.
- if ! isalphanumeric "$1"; then
+ if ! isalphanumeric "$if"; then
return
fi
- ifconfig $1 > /dev/null 2>&1
+ ifconfig $if > /dev/null 2>&1
if [ "$?" != "0" ]; then
return
fi
@@ -55,24 +56,24 @@ ifstart() {
cmd="${af#*!} ${name} ${mask} ${bcaddr} ${ext1} ${ext2}"
;;
"bridge")
- cmd="echo /etc/hostname.$1: bridges now supported via bridgename.* files"
+ cmd="echo /etc/hostname.$if: bridges now supported via bridgename.* files"
;;
"dhcp")
[ "$name" = "NONE" ] && name=
[ "$mask" = "NONE" ] && mask=
[ "$bcaddr" = "NONE" ] && bcaddr=
- ifconfig $1 $name $mask $bcaddr $ext1 $ext2 down
- cmd="dhclient $1"
+ ifconfig $if $name $mask $bcaddr $ext1 $ext2 down
+ cmd="dhclient $if"
;;
"rtsol")
- ifconfig $1 $name $mask $bcaddr $ext1 $ext2 up
- rtsolif="$rtsolif $1"
+ ifconfig $if $name $mask $bcaddr $ext1 $ext2 up
+ rtsolif="$rtsolif $if"
cmd=
;;
"up")
- # The only one of these guaranteed to be set is $1.
+ # The only one of these guaranteed to be set is $if.
# The remaining ones exist so that media controls work.
- cmd="ifconfig $1 $name $mask $bcaddr $ext1 $ext2 up"
+ cmd="ifconfig $if $name $mask $bcaddr $ext1 $ext2 up"
;;
*)
read dt dtaddr
@@ -87,7 +88,7 @@ ifstart() {
else
alias=
fi
- cmd="ifconfig $1 $af $alias $name "
+ cmd="ifconfig $if $af $alias $name "
case "$dt" in
dest)
cmd="$cmd $dtaddr"
@@ -97,7 +98,7 @@ ifstart() {
;;
esac
if [ ! -n "$name" ]; then
- echo "/etc/hostname.$1: invalid network configuration file"
+ echo "/etc/hostname.$if: invalid network configuration file"
return
fi
case $af in
@@ -119,7 +120,7 @@ ifstart() {
;;
esac
eval "$cmd"
- done < /etc/hostname.$1
+ done < /etc/hostname.$if
}
# Start the $1 bridge