diff options
Diffstat (limited to 'usr.sbin/bsdconfig/networking')
-rwxr-xr-x | usr.sbin/bsdconfig/networking/devices | 7 | ||||
-rwxr-xr-x | usr.sbin/bsdconfig/networking/networking | 16 | ||||
-rw-r--r-- | usr.sbin/bsdconfig/networking/share/device.subr | 14 | ||||
-rw-r--r-- | usr.sbin/bsdconfig/networking/share/media.subr | 9 | ||||
-rw-r--r-- | usr.sbin/bsdconfig/networking/share/resolv.subr | 9 |
5 files changed, 23 insertions, 32 deletions
diff --git a/usr.sbin/bsdconfig/networking/devices b/usr.sbin/bsdconfig/networking/devices index 11614f0..2ed9af80 100755 --- a/usr.sbin/bsdconfig/networking/devices +++ b/usr.sbin/bsdconfig/networking/devices @@ -73,13 +73,10 @@ f_mustberoot_init # defaultitem="" while :; do - f_dialog_menu_netdev "$defaultitem" - retval=$? - interface=$( f_dialog_menutag ) + f_dialog_menu_netdev "$defaultitem" || break + f_dialog_menutag_fetch interface defaultitem="$interface" - [ $retval -eq 0 ] || break - # # dialog_menu_netdev adds an asterisk (*) to the right of the # device name if the interface is active. Remove the asterisk diff --git a/usr.sbin/bsdconfig/networking/networking b/usr.sbin/bsdconfig/networking/networking index 5f69ccb..13d5018 100755 --- a/usr.sbin/bsdconfig/networking/networking +++ b/usr.sbin/bsdconfig/networking/networking @@ -67,8 +67,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -81,8 +81,9 @@ dialog_menu_main() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DEFAULTITEM_$$ "$dialog_menu" - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_data_sanitize menu_choice + f_dialog_menutag_store "$menu_choice" + setvar DEFAULTITEM_$$ "$menu_choice" return $retval } @@ -112,11 +113,8 @@ f_mustberoot_init # Launch application main menu # while :; do - dialog_menu_main - retval=$? - mtag=$( f_dialog_menutag ) - - [ $retval -eq 0 ] || f_die + dialog_menu_main || f_die + f_dialog_menutag_fetch mtag case "$mtag" in X) # Exit diff --git a/usr.sbin/bsdconfig/networking/share/device.subr b/usr.sbin/bsdconfig/networking/share/device.subr index f248c39..069086a 100644 --- a/usr.sbin/bsdconfig/networking/share/device.subr +++ b/usr.sbin/bsdconfig/networking/share/device.subr @@ -151,8 +151,8 @@ f_dialog_menu_netdev() \"\$prompt\" \ \"\$hline\" \ $interfaces - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local menu_choice + menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -165,7 +165,7 @@ f_dialog_menu_netdev() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_menutag_store -s "$menu_choice" return $retval } @@ -224,8 +224,8 @@ f_dialog_menu_netdev_edit() \"\$prompt\" \ \"\$hline\" \ $menu_list - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local tag + tag=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -240,10 +240,8 @@ f_dialog_menu_netdev_edit() $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) - local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" - local tag="$( f_dialog_menutag )" + f_dialog_data_sanitize tag if [ $retval -eq 2 ]; then # The Help button was pressed diff --git a/usr.sbin/bsdconfig/networking/share/media.subr b/usr.sbin/bsdconfig/networking/share/media.subr index e0e71e7..0ed7637 100644 --- a/usr.sbin/bsdconfig/networking/share/media.subr +++ b/usr.sbin/bsdconfig/networking/share/media.subr @@ -205,8 +205,8 @@ f_dialog_menu_media_options() local hline="$hline_arrows_tab_enter" - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local tag + tag=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -216,11 +216,10 @@ f_dialog_menu_media_options() $supported_media \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) - local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" + f_dialog_data_sanitize tag + if [ $retval -eq $SUCCESS ]; then - local tag="$( f_dialog_menutag )" options=$( eval f_dialog_menutag2item \"\$tag\" \ $supported_media ) [ "$options" = "$opt_none" ] && options= diff --git a/usr.sbin/bsdconfig/networking/share/resolv.subr b/usr.sbin/bsdconfig/networking/share/resolv.subr index e439d38..0793c81 100644 --- a/usr.sbin/bsdconfig/networking/share/resolv.subr +++ b/usr.sbin/bsdconfig/networking/share/resolv.subr @@ -435,8 +435,8 @@ f_dialog_menu_nameservers() \"\$prompt\" \ \"\$hline\" \ $menu_list - local dialog_menu - dialog_menu=$( eval $DIALOG \ + local tag + tag=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -448,10 +448,8 @@ f_dialog_menu_nameservers() $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) - local retval=$? - setvar DIALOG_MENU_$$ "$dialog_menu" - local tag="$( f_dialog_menutag )" ns="" + f_dialog_data_sanitize tag # Return if "Cancel" was chosen (-1) or ESC was pressed (255) if [ $retval -ne $SUCCESS ]; then @@ -467,6 +465,7 @@ f_dialog_menu_nameservers() f_dialog_input_nameserver ;; *) + local n ns n=$( eval f_dialog_menutag2index \"\$tag\" $menu_list ) ns=$( eval f_dialog_menutag2item \"\$tag\" $menu_list ) f_dialog_input_nameserver $(( $n - 2 )) "$ns" |