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
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to