summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorRobert Peichaer <rpe@cvs.openbsd.org>2017-04-07 22:53:26 +0000
committerRobert Peichaer <rpe@cvs.openbsd.org>2017-04-07 22:53:26 +0000
commit943bc75a32455735effffa7682617f2b1b09d2d8 (patch)
tree20909fe989ba2be2cb57ddf695541f88bbcf78c3 /etc
parent3177f319273c6a4ff17651847f1a6fb51141ff18 (diff)
Minimize differences in ifstart() function between netstart and
install.sub which makes it easier to spot changes in the future. - comments and formatting - quotes on assignments are not needed (netstart) - remove stray space in test (netstart) - use $file variable with while-loop (netstart) - although valid, instead of i use $i in arithmetic test (install.sub) OK krw@, tb@ Looks good deraadt@
Diffstat (limited to 'etc')
-rw-r--r--etc/netstart11
1 files changed, 6 insertions, 5 deletions
diff --git a/etc/netstart b/etc/netstart
index 88476411356..6586b069c9f 100644
--- a/etc/netstart
+++ b/etc/netstart
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# $OpenBSD: netstart,v 1.174 2017/04/07 22:15:17 rpe Exp $
+# $OpenBSD: netstart,v 1.175 2017/04/07 22:53:25 rpe Exp $
# Turn off Strict Bourne shell mode.
set +o sh
@@ -51,7 +51,7 @@ ifstart() {
# We are carrying over from the 'read dt dtaddr'
# last time.
set -- $cmd2
- af="$1" name="$2" mask="$3" bcaddr="$4" ext1="$5" cmd2=
+ af=$1 name=$2 mask=$3 bcaddr=$4 ext1=$5 cmd2=
# Make sure and get any remaining args in ext2,
# like the read below.
i=1
@@ -64,7 +64,8 @@ ifstart() {
# $af can be "dhcp", "up", "rtsol", an address family, commands,
# or a comment.
case "$af" in
- "#"*|"") # Skip comments and empty lines.
+ "#"*|"")
+ # Skip comments and empty lines.
continue
;;
"!"*) # Parse commands.
@@ -84,7 +85,7 @@ ifstart() {
;;
*)
read dt dtaddr
- if [ "$name" = "alias" ]; then
+ if [ "$name" = "alias" ]; then
# Perform a 'shift' of sorts.
alias=$name
name=$mask
@@ -131,7 +132,7 @@ ifstart() {
;;
esac
eval "$cmd"
- done </etc/hostname.$if
+ done <$file
}
# Start multiple interfaces by driver name.