mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 00:02:14 -04:00
The --no-items and --stdout options are non-standard and should be avoided
From the dialog(1) manual: using [--stdout] in portable scripts is not recommended
This commit is contained in:
parent
6e038cc2eb
commit
95ee591e83
1 changed files with 19 additions and 13 deletions
|
|
@ -90,8 +90,13 @@ dialog_country_select()
|
||||||
# Parse available countries/regdomains
|
# Parse available countries/regdomains
|
||||||
#
|
#
|
||||||
input=$( ifconfig "$WLAN_IFACE" list countries | sed -e 's/DEBUG//gi' )
|
input=$( ifconfig "$WLAN_IFACE" list countries | sed -e 's/DEBUG//gi' )
|
||||||
regdomains=$( echo $input | sed -e 's/.*domains://' | tr ' ' '\n' |
|
regdomains=$( echo "$input" | awk '
|
||||||
sort | tr '\n' ' ' )
|
sub(/.*domains:/, ""), /[^[:alnum:][[:space:]]/ {
|
||||||
|
n = split($0, domains)
|
||||||
|
for (i = 1; i <= n; i++)
|
||||||
|
printf "'\''%s'\'' '\'\''", domains[i]
|
||||||
|
}
|
||||||
|
' )
|
||||||
countries=$( echo "$input" | awk '
|
countries=$( echo "$input" | awk '
|
||||||
sub(/Country codes:/, ""), sub(/Regulatory.*/, "") {
|
sub(/Country codes:/, ""), sub(/Regulatory.*/, "") {
|
||||||
while (match($0, /[[:upper:]][[:upper:][:digit:]] /)) {
|
while (match($0, /[[:upper:]][[:upper:][:digit:]] /)) {
|
||||||
|
|
@ -108,17 +113,18 @@ dialog_country_select()
|
||||||
|
|
||||||
f_dialog_title "Regdomain selection"
|
f_dialog_title "Regdomain selection"
|
||||||
prompt="Select your regdomain."
|
prompt="Select your regdomain."
|
||||||
f_dialog_menu_size height width rows "$DIALOG_TITLE" \
|
eval f_dialog_menu_size height width rows \
|
||||||
"$DIALOG_BACKTITLE" "$prompt" "" $regdomains
|
\"\$DIALOG_TITLE\" \"\$DIALOG_BACKTITLE\" \
|
||||||
regdomain=$( sh -c "$DIALOG \
|
\"\$prompt\" \"\" $regdomains
|
||||||
--title \"$DIALOG_TITLE\" \
|
regdomain=$( eval $DIALOG \
|
||||||
--backtitle \"$DIALOG_BACKTITLE\" \
|
--title \"\$DIALOG_TITLE\" \
|
||||||
--cancel-label \"$msg_skip\" \
|
--backtitle \"\$DIALOG_BACKTITLE\" \
|
||||||
--default-item \"$default_regdomain\" \
|
--cancel-label \"\$msg_skip\" \
|
||||||
--no-items \
|
--default-item \"\$default_regdomain\" \
|
||||||
--stdout \
|
--menu \"\$prompt\" \
|
||||||
--menu \"$prompt\" \
|
$height $width $rows \
|
||||||
$height $width $rows $regdomains"
|
$regdomains \
|
||||||
|
2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
|
||||||
)
|
)
|
||||||
|
|
||||||
f_dialog_title "Country selection"
|
f_dialog_title "Country selection"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue