Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Dec 2016 18:24:41 +0000 (UTC)
From:      Devin Teske <dteske@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r309907 - head/usr.sbin/bsdinstall/scripts
Message-ID:  <201612121824.uBCIOfrN064847@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dteske
Date: Mon Dec 12 18:24:41 2016
New Revision: 309907
URL: https://svnweb.freebsd.org/changeset/base/309907

Log:
  Replace funny block with something easy to digest

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:21:56 2016	(r309906)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:24:41 2016	(r309907)
@@ -43,19 +43,10 @@ country_set()
 	# Setup what was selected
 	# NB: Do not change order of arguments (or regdomain will be ignored)
 	#
-	if [ "$2" ]; then
-		ifconfig_args="${ifconfig_args}country $2"
-	fi
-	if [ "$1" ]; then
-		if [ "$2" ]; then
-			ifconfig_args="${ifconfig_args} "
-		fi
-		ifconfig_args="${ifconfig_args}regdomain $1"
-	fi
-	if [ ! "$ifconfig_args" ]; then
-		# Nothing to do (everything was skipped)
-		return $SUCCESS
-	fi
+	[ "$2" ] && ifconfig_args="$ifconfig_args country $2"
+	[ "$1" ] && ifconfig_args="$ifconfig_args regdomain $1"
+	[ "$ifconfig_args" ] || return $SUCCESS # Nothing to do
+	ifconfig_args="${ifconfig_args# }"
 
 	# Regdomain/country cannot be applied while interface is running
 	iface_up=$( ifconfig -lu | grep -w $WLAN_IFACE )



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201612121824.uBCIOfrN064847>