Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Dec 2016 18:28:20 +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: r309908 - head/usr.sbin/bsdinstall/scripts
Message-ID:  <201612121828.uBCISKHj065009@repo.freebsd.org>

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

Log:
  Collapse tiny if statements

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

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:24:41 2016	(r309907)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:28:20 2016	(r309908)
@@ -50,9 +50,7 @@ country_set()
 
 	# Regdomain/country cannot be applied while interface is running
 	iface_up=$( ifconfig -lu | grep -w $WLAN_IFACE )
-	if [ "$iface_up" ]; then
-		ifconfig $WLAN_IFACE down
-	fi
+	[ "$iface_up" ] && ifconfig $WLAN_IFACE down
 	error_str=$( ifconfig $WLAN_IFACE $ifconfig_args 2>&1 |
 		sed 's/ifconfig: //' )
 	if [ "$iface_up" ]; then
@@ -179,13 +177,9 @@ if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
 	WLAN_IFACE=$( wpa_cli ifname | tail -n 1 )
 	INPUT=$( ifconfig $WLAN_IFACE list regdomain | head -n 1 )
 	DEF_REGDOMAIN=$( echo $INPUT | cut -w -f 2 )
-	if [ "$DEF_REGDOMAIN" = "0" ]; then
-		DEF_REGDOMAIN="<not selected>"
-	fi
+	[ "$DEF_REGDOMAIN" = "0" ] && DEF_REGDOMAIN="<not selected>"
 	DEF_COUNTRY=$( echo $INPUT | cut -w -f 4 )
-	if [ "$DEF_COUNTRY" = "0" ]; then
-		DEF_COUNTRY="<not selected>"
-	fi
+	[ "$DEF_COUNTRY" = "0" ] && DEF_COUNTRY="<not selected>"
 	dialog --backtitle "FreeBSD Installer" --title "Regdomain/country" \
 	    --yesno "Change regdomain/country (now \
 	    $DEF_REGDOMAIN/$DEF_COUNTRY)?" 0 0



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