From 24811c971d85b565a9b26a88245a556b0ccfb9f6 Mon Sep 17 00:00:00 2001 From: rpe Date: Fri, 7 Apr 2017 22:15:17 +0000 Subject: [PATCH] Align comments of ifstart() function in netstart and install.sub. --- distrib/miniroot/install.sub | 21 ++++++++++----------- etc/netstart | 5 ++++- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index 8b8aace02ac..e81f59aa9b2 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: install.sub,v 1.993 2017/04/07 22:02:29 rpe Exp $ +# $OpenBSD: install.sub,v 1.994 2017/04/07 22:15:17 rpe Exp $ # # Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback # Copyright (c) 2015, Robert Peichaer @@ -2124,25 +2124,24 @@ ifstart () { ((NIFS++)) while :; do if [ "$cmd2" ]; then - # we are carrying over from the 'read dt dtaddr' - # last time + # We are carrying over from the 'read dt dtaddr' + # last time. set -- $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 + # Make sure and get any remaining args in ext2, + # like the read below. i=1 while [ i -lt 6 -a -n "$1" ]; do shift; let i=i+1; done ext2="$@" else - # read the next line or exit the while loop + # Read the next line or exit the while loop. read af name mask bcaddr ext1 ext2 || break fi - # $af can be "dhcp", "rtsol", an address family, - # commands, or a comment. + # $af can be "dhcp", "rtsol", an address family, commands, + # or a comment. case "$af" in "#"*|"!"*|"bridge"|"") - # skip comments, user commands, bridges, - # and empty lines + # Skip comments, user commands, bridges, and empty lines. continue ;; "dhcp") [ "$name" = "NONE" ] && name= @@ -2166,7 +2165,7 @@ ifstart () { ;; *) read dt dtaddr if [ "$name" = "alias" ]; then - # perform a 'shift' of sorts + # Perform a 'shift' of sorts. alias=$name name=$mask mask=$bcaddr diff --git a/etc/netstart b/etc/netstart index b57be3c624d..88476411356 100644 --- a/etc/netstart +++ b/etc/netstart @@ -1,6 +1,6 @@ #!/bin/sh - # -# $OpenBSD: netstart,v 1.173 2017/04/07 21:44:07 rpe Exp $ +# $OpenBSD: netstart,v 1.174 2017/04/07 22:15:17 rpe Exp $ # Turn off Strict Bourne shell mode. set +o sh @@ -22,7 +22,10 @@ stripcom() { # Start a single interface. # Usage: ifstart if1 ifstart() { + # Note: Do not rename the 'if' variable which is documented as being + # usable in hostname.if(5) files. if=$1 + # Interface names must be alphanumeric only. We check to avoid # configuring backup or temp files, and to catch the "*" case. [[ $if != +([[:alpha:]])+([[:digit:]]) ]] && return -- 2.20.1