diff options
Diffstat (limited to 'usr.sbin/bsdconfig/startup/share/rcconf.subr')
-rw-r--r-- | usr.sbin/bsdconfig/startup/share/rcconf.subr | 38 |
1 files changed, 10 insertions, 28 deletions
diff --git a/usr.sbin/bsdconfig/startup/share/rcconf.subr b/usr.sbin/bsdconfig/startup/share/rcconf.subr index 16cb290..8878d2c 100644 --- a/usr.sbin/bsdconfig/startup/share/rcconf.subr +++ b/usr.sbin/bsdconfig/startup/share/rcconf.subr @@ -30,6 +30,7 @@ if [ ! "$_STARTUP_RCCONF_SUBR" ]; then _STARTUP_RCCONF_SUBR=1 BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 +f_dprintf "%s: loading includes..." startup/rcconf.subr f_include $BSDCFG_SHARE/sysrc.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="140.startup" @@ -418,39 +419,16 @@ f_dialog_input_rclist() # f_dialog_input_rcvar() { - local msg="$msg_please_enter_rcvar_name" - local hline="$hline_alnum_tab_enter" - # # Loop until the user provides taint-free/valid input # - local size _input="$1" + local _input="$1" while :; do - size=$( f_dialog_inputbox_size \ - "$DIALOG_TITLE" \ - "$DIALOG_BACKTITLE" \ - "$msg" \ - "$_input" \ - "$hline" ) - - local dialog_inputbox - dialog_inputbox=$( eval $DIALOG \ - --title \"\$DIALOG_TITLE\" \ - --backtitle \"\$DIALOG_BACKTITLE\" \ - --hline \"\$hline\" \ - --ok-label \"\$msg_ok\" \ - --cancel-label \"\$msg_cancel\" \ - --inputbox \"\$msg\" $size \ - \"\$_input\" \ - 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD - ) - - retval=$? - setvar DIALOG_INPUTBOX_$$ "$dialog_inputbox" - _input=$( f_dialog_inputstr ) # Return if user either pressed ESC or chosen Cancel/No - [ $retval -eq $SUCCESS ] || return $retval + _input=$( f_dialog_input "$msg_please_enter_rcvar_name" \ + "$_input" "$hline_alnum_tab_enter" + ) || return # Check for invalid entry (1of2) if ! echo "$_input" | grep -q "^[[:alpha:]_]"; then @@ -469,9 +447,13 @@ f_dialog_input_rcvar() break done - f_dprintf "f_dialog_input_rcvar: rcvar->[$rcvar]" + f_dprintf "f_dialog_input_rcvar: rcvar->[%s]" "$rcvar" return $SUCCESS } +############################################################ MAIN + +f_dprintf "%s: Successfully loaded." startup/rcconf.subr + fi # ! $_STARTUP_RCCONF_SUBR |