summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bsdconfig/networking/share/media.subr
diff options
context:
space:
mode:
authordteske <dteske@FreeBSD.org>2012-09-20 23:44:13 +0000
committerdteske <dteske@FreeBSD.org>2012-09-20 23:44:13 +0000
commitf628c47944e7370c8d8c16cdcc6f98871a48be02 (patch)
tree6eb395555fa780676e51155e913c807210bdc403 /usr.sbin/bsdconfig/networking/share/media.subr
parent3a2b0e2811fa295dd198978ef2dcb53b37c2570d (diff)
downloadFreeBSD-src-f628c47944e7370c8d8c16cdcc6f98871a48be02.zip
FreeBSD-src-f628c47944e7370c8d8c16cdcc6f98871a48be02.tar.gz
Change all invocations of dialog(1) to no-longer require temporary files.
This allows bsdconfig to -- like bsdinstall -- operate from read-only media. Reviewed by: adrian (co-mentor) Approved by: adrian (co-mentor)
Diffstat (limited to 'usr.sbin/bsdconfig/networking/share/media.subr')
-rw-r--r--usr.sbin/bsdconfig/networking/share/media.subr14
1 files changed, 10 insertions, 4 deletions
diff --git a/usr.sbin/bsdconfig/networking/share/media.subr b/usr.sbin/bsdconfig/networking/share/media.subr
index c546220..e7da98a 100644
--- a/usr.sbin/bsdconfig/networking/share/media.subr
+++ b/usr.sbin/bsdconfig/networking/share/media.subr
@@ -123,7 +123,8 @@ f_dialog_input_options()
local msg="$( printf "$msg_please_enter_mediaopts" "$interface" )"
local hline="$hline_alnum_punc_tab_enter"
- $DIALOG \
+ local dialog_inputbox
+ dialog_inputbox=$( $DIALOG \
--title "$DIALOG_TITLE" \
--backtitle "$DIALOG_BACKTITLE" \
--hline "$hline" \
@@ -131,9 +132,11 @@ f_dialog_input_options()
--cancel-label "$msg_cancel" \
--inputbox "$msg" 9 70 \
"$options" \
- 2> "$DIALOG_TMPDIR/dialog.inputbox.$$"
+ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
+ )
local retval=$?
+ setvar DIALOG_INPUTBOX_$$ "$dialog_inputbox"
local _options="$( f_dialog_inputstr )"
[ $retval -eq $SUCCESS ] && options="$_options"
@@ -205,7 +208,8 @@ f_dialog_menu_media_options()
local hline="$hline_arrows_tab_enter"
- eval $DIALOG \
+ local dialog_menu
+ dialog_menu=$( eval $DIALOG \
--clear --title \"\$DIALOG_TITLE\" \
--backtitle \"\$DIALOG_BACKTITLE\" \
--hline \"\$hline\" \
@@ -213,9 +217,11 @@ f_dialog_menu_media_options()
--cancel-label \"\$msg_cancel\" \
--menu \"\$msg\" 21 60 12 \
$supported_media \
- 2> "$DIALOG_TMPDIR/dialog.menu.$$"
+ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
+ )
local retval=$?
+ setvar DIALOG_MENU_$$ "$dialog_menu"
if [ $retval -eq $SUCCESS ]; then
local tag="$( f_dialog_menutag )"
options=$( eval f_dialog_menutag2item \"\$tag\" \
OpenPOWER on IntegriCloud