diff options
author | 2015-07-19 04:44:36 +0000 | |
---|---|---|
committer | 2015-07-19 04:44:36 +0000 | |
commit | c1cf6742024e35812b59ca7889847d987c93f0c9 (patch) | |
tree | 0f6d14e8ba101ad052c27ec4ca4c75a0e42d520c | |
parent | Only close descriptor if not already closed. (diff) | |
download | wireguard-openbsd-c1cf6742024e35812b59ca7889847d987c93f0c9.tar.xz wireguard-openbsd-c1cf6742024e35812b59ca7889847d987c93f0c9.zip |
Replace test command with [].
OK halex@ krw@
-rw-r--r-- | etc/netstart | 13 | ||||
-rw-r--r-- | etc/rc | 10 |
2 files changed, 11 insertions, 12 deletions
diff --git a/etc/netstart b/etc/netstart index ec3a986d6da..f95ff6e3453 100644 --- a/etc/netstart +++ b/etc/netstart @@ -1,6 +1,6 @@ #!/bin/sh - # -# $OpenBSD: netstart,v 1.148 2015/07/19 01:37:45 rpe Exp $ +# $OpenBSD: netstart,v 1.149 2015/07/19 04:44:36 rpe Exp $ # Strip comments (and leading/trailing whitespace if IFS is set) from a file # and spew to stdout. @@ -132,19 +132,18 @@ ifmstart() { for hn in /etc/hostname.*; do # Strip off /etc/hostname. prefix. if=${hn#/etc/hostname.} - test "$if" = "*" && continue + [ "$if" = "*" ] && continue # Skip unwanted ifs. s="" for xf in $2; do - test "$xf" = "${if%%[0-9]*}" && s="1" && break + [ "$xf" = "${if%%[0-9]*}" ] && s="1" && break done - test "$s" = "1" && continue + [ "$s" = "1" ] && continue # Start wanted ifs. - test "$sif" = "ALL" -o \ - "$sif" = "${if%%[0-9]*}" \ - && ifstart $if + [ "$sif" = "ALL" -o "$sif" = "${if%%[0-9]*}" ] && + ifstart $if done done } @@ -1,4 +1,4 @@ -# $OpenBSD: rc,v 1.452 2015/07/18 21:12:40 rpe Exp $ +# $OpenBSD: rc,v 1.453 2015/07/19 04:44:36 rpe Exp $ # System startup script run by init on autoboot or after single-user. # Output and error are redirected to console by init, and the console is the @@ -16,7 +16,7 @@ stripcom() { { while read _line ; do _line=${_line%%#*} # strip comments - test -z "$_line" && continue + [ -z "$_line" ] && continue echo $_line done } <$_file @@ -53,7 +53,7 @@ update_limit() { # Apply sysctl(8) settings. sysctl_conf() { - test -s /etc/sysctl.conf || return + [ -s /etc/sysctl.conf ] || return # delete comments and blank lines set -- `stripcom /etc/sysctl.conf` @@ -74,7 +74,7 @@ sysctl_conf() { # Apply mixerctl(1) settings. mixerctl_conf() { - test -s /etc/mixerctl.conf || return + [ -s /etc/mixerctl.conf ] || return # delete comments and blank lines set -- `stripcom /etc/mixerctl.conf` @@ -88,7 +88,7 @@ mixerctl_conf() { wsconsctl_conf() { local save_IFS="$IFS" - test -x /sbin/wsconsctl -a -s /etc/wsconsctl.conf || return + [ -x /sbin/wsconsctl -a -s /etc/wsconsctl.conf ] || return # delete comments and blank lines IFS=" " |