svn commit: r309922 - head/usr.sbin/bsdinstall/scripts

Devin Teske dteske at FreeBSD.org
Mon Dec 12 19:01:06 UTC 2016


Author: dteske
Date: Mon Dec 12 19:01:04 2016
New Revision: 309922
URL: https://svnweb.freebsd.org/changeset/base/309922

Log:
  Centralize backtitle string

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

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 18:56:40 2016	(r309921)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 19:01:04 2016	(r309922)
@@ -32,6 +32,7 @@
 BSDCFG_SHARE="/usr/share/bsdconfig"
 . $BSDCFG_SHARE/common.subr || exit 1
 f_include $BSDCFG_SHARE/dialog.subr
+f_dialog_backtitle "FreeBSD Installer"
 
 ############################################################ FUNCTIONS
 
@@ -59,7 +60,7 @@ country_set()
 			"$BSDINSTALL_TMPETC/wpa_supplicant.conf"
 	fi
 	if [ "$error_str" ]; then
-		dialog --backtitle "FreeBSD Installer" --title "Error" \
+		dialog --backtitle "$DIALOG_BACKTITLE" --title "Error" \
 			--yes-label Change --no-label Ignore --yesno \
 			"Error while applying chosen settings ($error_str)" 0 0
 		if [ $? -eq $DIALOG_OK ]; then
@@ -112,10 +113,10 @@ dialog_country_select()
 	fi
 
 	f_dialog_menu_size height width rows \"Regdomain selection\" \
-		\"FreeBSD Installer\" \"Select your regdomain.\" \
+		\"$DIALOG_BACKTITLE\" \"Select your regdomain.\" \
 		\"\" $regdomains
 	regdomain=$( sh -c "dialog \
-		--backtitle \"FreeBSD Installer\" \
+		--backtitle \"$DIALOG_BACKTITLE\" \
 		--title \"Regdomain selection\" \
 		--cancel-label \"Skip\" \
 		$def_item_regdomain \
@@ -126,10 +127,10 @@ dialog_country_select()
 	)
 
 	f_dialog_menu_size height width rows \"Country selection\" \
-	    \"FreeBSD Installer\" \"Select your country.\" \
+	    \"$DIALOG_BACKTITLE\" \"Select your country.\" \
 	    \"\" $countries
 	country=$( sh -c "dialog \
-		--backtitle \"FreeBSD Installer\" \
+		--backtitle \"$DIALOG_BACKTITLE\" \
 		--title \"Country selection\" \
 		--cancel-label \"Skip\" \
 		$def_item_country \
@@ -160,13 +161,13 @@ echo >> "$BSDINSTALL_TMPETC/wpa_supplica
 #
 (wpa_cli ping >/dev/null 2>/dev/null || ([ "$BSDINSTALL_CONFIGCURRENT" ] &&
 	wpa_supplicant -B -i $1 -c "$BSDINSTALL_TMPETC/wpa_supplicant.conf")) ||
-	(dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox \
+	(dialog --backtitle "$DIALOG_BACKTITLE" --title "Error" --msgbox \
 	"Could not start wpa_supplicant!" 0 0; exit 1) || exit 1
 
 # See if we succeeded
 wpa_cli ping >/dev/null 2>/dev/null
 if [ $? -ne 0 -a ! "$BSDINSTALL_CONFIGCURRENT" ]; then
-	dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox \
+	dialog --backtitle "$DIALOG_BACKTITLE" --title "Error" --msgbox \
 	"Wireless cannot be configured without making changes to the local system!" \ 0 0
 	exit 1
 fi
@@ -183,7 +184,7 @@ if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
 	DEF_COUNTRY=$( echo $INPUT | cut -w -f 4 )
 	[ "$DEF_REGDOMAIN" = 0 ] && DEF_REGDOMAIN="<not selected>"
 	[ "$DEF_COUNTRY" = 0 ] && DEF_COUNTRY="<not selected>"
-	dialog --backtitle "FreeBSD Installer" --title "Regdomain/country" \
+	dialog --backtitle "$DIALOG_BACKTITLE" --title "Regdomain/country" \
 	    --yesno "Change regdomain/country (now \
 	    $DEF_REGDOMAIN/$DEF_COUNTRY)?" 0 0
 	if [ $? -eq 0 ]; then
@@ -201,7 +202,7 @@ while :; do
 	SCANSSID=0
 	output=$( wpa_cli scan 2>&1 )
 	f_dprintf "%s" "$output"
-	dialog --backtitle "FreeBSD Installer" --title "Scanning" \
+	dialog --backtitle "$DIALOG_BACKTITLE" --title "Scanning" \
 	    --ok-label "Skip" \
 	    --pause "Waiting 5 seconds to scan for wireless networks..." \
 	    9 40 5 || exit 1
@@ -212,7 +213,7 @@ while :; do
 	   printf("\"%s\"\t%s\n", $5, $4);}' | sort | uniq )
 
 	if [ ! "$NETWORKS" ]; then
-		dialog --backtitle "FreeBSD Installer" --title "Error" \
+		dialog --backtitle "$DIALOG_BACKTITLE" --title "Error" \
 		    --yesno "No wireless networks were found. Rescan?" 0 0 &&
 		    continue
 		exit 1
@@ -220,7 +221,7 @@ while :; do
 
 	exec 3>&1
 	NETWORK=$( sh -c "dialog --extra-button --extra-label \"Rescan\" \
-	    --backtitle \"FreeBSD Installer\" --title \"Network Selection\" \
+	    --backtitle \"$DIALOG_BACKTITLE\" --title \"Network Selection\" \
 	    --menu \"Select a wireless network to connect to.\" 0 0 0 \
 	    $(echo $NETWORKS | tr '\n' ' ')" 2>&1 1>&3 )
 	case $? in
@@ -250,7 +251,7 @@ done
 
 if echo $ENCRYPTION | grep -q 'PSK'; then
 	exec 3>&1
-	PASS=$( dialog --insecure --backtitle "FreeBSD Installer" \
+	PASS=$( dialog --insecure --backtitle "$DIALOG_BACKTITLE" \
 	    --title "WPA Setup" --mixedform "" 0 0 0 \
 		"SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
 		"Password" 2 0 "" 2 12 15 63 1 \
@@ -265,7 +266,7 @@ echo "network={
 }" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
 elif echo $ENCRYPTION | grep -q EAP; then
 	exec 3>&1
-	USERPASS=$( dialog --insecure --backtitle "FreeBSD Installer" \
+	USERPASS=$( dialog --insecure --backtitle "$DIALOG_BACKTITLE" \
 	    --title "WPA-Enterprise Setup" --mixedform "" 0 0 0 \
 		"SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
 		"Username" 2 0 "" 2 12 25 63 0 \
@@ -289,7 +290,7 @@ echo "	priority=5
 }" >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
 elif echo $ENCRYPTION | grep -q WEP; then
 	exec 3>&1
-	WEPKEY=$( dialog --insecure --backtitle "FreeBSD Installer" \
+	WEPKEY=$( dialog --insecure --backtitle "$DIALOG_BACKTITLE" \
 	    --title "WEP Setup" --mixedform "" 0 0 0 \
 		"SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
 		"WEP Key 0" 2 0 "" 2 12 15 0 1 \


More information about the svn-src-head mailing list