Perform some code consolidation and add some additional error
checking/reporting. (similar to SVN revisions 251919 and 251928)
This commit is contained in:
parent
4f85870720
commit
df750a6ced
@ -121,21 +121,22 @@ while :; do
|
||||
dialog_menu_main || f_die
|
||||
f_dialog_menutag_fetch mtag
|
||||
|
||||
command=
|
||||
case "$mtag" in
|
||||
"X $msg_exit") break ;;
|
||||
"2 $msg_font") # Choose an alternate screen font
|
||||
$BSDCFG_LIBE/$APP_DIR/font ${USE_XDIALOG:+-X} ;;
|
||||
"3 $msg_keymap") # Choose an alternate keyboard map
|
||||
$BSDCFG_LIBE/$APP_DIR/keymap ${USE_XDIALOG:+-X} ;;
|
||||
"4 $msg_repeat") # Set the rate at which keys repeat
|
||||
$BSDCFG_LIBE/$APP_DIR/repeat ${USE_XDIALOG:+-X} ;;
|
||||
"5 $msg_saver") # Configure the screen saver
|
||||
$BSDCFG_LIBE/$APP_DIR/saver ${USE_XDIALOG:+-X} ;;
|
||||
"6 $msg_screenmap") # Choose an alternate screenmap
|
||||
$BSDCFG_LIBE/$APP_DIR/screenmap ${USE_XDIALOG:+-X} ;;
|
||||
"7 $msg_ttys") # Choose console terminal type
|
||||
$BSDCFG_LIBE/$APP_DIR/ttys ${USE_XDIALOG:+-X} ;;
|
||||
"X $msg_exit") break ;;
|
||||
"2 $msg_font") command=font ;; # Choose alternate screen font
|
||||
"3 $msg_keymap") command=keymap ;; # Choose alt. keyboard map
|
||||
"4 $msg_repeat") command=repeat ;; # Set key repeat rate
|
||||
"5 $msg_saver") command=saver ;; # Configure the screen saver
|
||||
"6 $msg_screenmap") command=screenmap ;; # Choose alternate screenmap
|
||||
"7 $msg_ttys") command=ttys ;; # Choose console terminal type
|
||||
esac
|
||||
|
||||
if [ "$command" ]; then
|
||||
$BSDCFG_LIBE/$APP_DIR/$command ${USE_XDIALOG:+-X} ;;
|
||||
else
|
||||
f_die 1 "$msg_unknown_console_menu_selection"
|
||||
fi
|
||||
done
|
||||
|
||||
exit $SUCCESS
|
||||
|
@ -241,6 +241,7 @@ msg_ukrainian_koi8_u="Ukranian KOI8-U"
|
||||
msg_ukrainian_koi8_u_desc="Ukranian KOI8-U keymap"
|
||||
msg_ukrainian_koi8_u_koi8_r="Ukranian KOI8-U+KOI8-R"
|
||||
msg_ukrainian_koi8_u_koi8_r_desc="Ukranian KOI8-U+KOI8-R keymap (alter)"
|
||||
msg_unknown_console_menu_selection="Unknown console menu selection"
|
||||
msg_unknown_font_selection="Unknown font selection"
|
||||
msg_unknown_keymap="Unknown keymap"
|
||||
msg_unknown_repeat_rate="Unknown repeat rate"
|
||||
|
@ -104,6 +104,7 @@ msg_startup_dirs_desc="Set the list of dirs to look for startup scripts"
|
||||
msg_svr4="SVR4"
|
||||
msg_svr4_desc="This host wants to be able to run SVR4 binaries."
|
||||
msg_toggle_startup_services="Toggle Startup Services"
|
||||
msg_unknown_startup_menu_selection="Unknown startup menu selection"
|
||||
msg_value_required="Value Required"
|
||||
msg_view_details="View Details"
|
||||
msg_view_details_desc="Choose view details"
|
||||
|
@ -118,16 +118,19 @@ while :; do
|
||||
dialog_menu_main || f_die
|
||||
f_dialog_menutag_fetch mtag
|
||||
|
||||
command=
|
||||
case "$mtag" in
|
||||
X) # Exit
|
||||
break ;;
|
||||
1) # Toggle Startup Services
|
||||
$BSDCFG_LIBE/$APP_DIR/rcvar ${USE_XDIALOG:+-X} ;;
|
||||
2) # View/Edit Startup Configuration
|
||||
$BSDCFG_LIBE/$APP_DIR/rcconf ${USE_XDIALOG:+-X} ;;
|
||||
3) # Miscellaneous Startup Services
|
||||
$BSDCFG_LIBE/$APP_DIR/misc ${USE_XDIALOG:+-X} ;;
|
||||
X) break ;;
|
||||
1) command=rcvar ;; # Toggle Startup Services
|
||||
2) command=rcconf ;; # View/Edit Startup Configuration
|
||||
3) command=misc ;; # Miscellaneous Startup Services
|
||||
esac
|
||||
|
||||
if [ "$command" ]; then
|
||||
$BSDCFG_LIBE/$APP_DIR/$command ${USE_XDIALOG:+-X} ;;
|
||||
else
|
||||
f_die 1 "$msg_unknown_startup_menu_selection"
|
||||
fi
|
||||
done
|
||||
|
||||
exit $SUCCESS
|
||||
|
@ -105,6 +105,7 @@ msg_separated_by_commas="Separated by commas"
|
||||
msg_select_group_members_from_list="Select Group Members from a list"
|
||||
msg_select_login_shell="Select Login Shell"
|
||||
msg_shell="Shell"
|
||||
msg_unknown_user_management_menu_selection="Unknown user management menu selection"
|
||||
msg_use_default_values_for_all_account_details="Use default values for all account details?"
|
||||
msg_user="User"
|
||||
msg_user_id="UID"
|
||||
|
@ -144,38 +144,26 @@ while :; do
|
||||
f_die
|
||||
fi
|
||||
|
||||
command=
|
||||
case "$mtag" in
|
||||
X) # Exit
|
||||
exit 0
|
||||
;;
|
||||
|
||||
1) # Add User
|
||||
$BSDCFG_LIBE/$APP_DIR/useradd ${USE_XDIALOG:+-X}
|
||||
;;
|
||||
|
||||
2) # Edit/View User
|
||||
$BSDCFG_LIBE/$APP_DIR/useredit ${USE_XDIALOG:+-X}
|
||||
;;
|
||||
|
||||
3) # Delete User
|
||||
$BSDCFG_LIBE/$APP_DIR/userdel ${USE_XDIALOG:+-X}
|
||||
;;
|
||||
|
||||
4) # Add Group
|
||||
$BSDCFG_LIBE/$APP_DIR/groupadd ${USE_XDIALOG:+-X}
|
||||
;;
|
||||
|
||||
5) # Edit/View Group
|
||||
$BSDCFG_LIBE/$APP_DIR/groupedit ${USE_XDIALOG:+-X}
|
||||
;;
|
||||
|
||||
6) # Delete Group
|
||||
$BSDCFG_LIBE/$APP_DIR/groupdel ${USE_XDIALOG:+-X}
|
||||
;;
|
||||
|
||||
X) break ;;
|
||||
1) command=useradd ;; # Add User
|
||||
2) command=useredit ;; # Edit/View User
|
||||
3) command=userdel ;; # Delete User
|
||||
4) command=groupadd ;; # Add Group
|
||||
5) command=groupedit ;; # Edit/View Group
|
||||
6) command=groupdel ;; # Delete Group
|
||||
esac
|
||||
|
||||
if [ "$command" ]; then
|
||||
$BSDCFG_LIBE/$APP_DIR/$command ${USE_XDIALOG:+-X}
|
||||
else
|
||||
f_die 1 "$msg_unknown_user_management_menu_selection"
|
||||
fi
|
||||
done
|
||||
|
||||
exit $SUCCESS
|
||||
|
||||
################################################################################
|
||||
# END
|
||||
################################################################################
|
||||
|
Loading…
x
Reference in New Issue
Block a user