use case to dispatch internationalisation menu functions

This commit is contained in:
Alex Bradbury 2013-05-22 20:17:32 +01:00
parent 3d725a80fa
commit c85396d754

View File

@ -178,17 +178,17 @@ do_change_pass() {
whiptail --msgbox "Password changed successfully" 20 60 1
}
do_I3() { # Keyboard
do_configure_keyboard() {
dpkg-reconfigure keyboard-configuration &&
printf "Reloading keymap. This may take a short while\n" &&
invoke-rc.d keyboard-setup start
}
do_I1() { # Locale
do_change_locale() {
dpkg-reconfigure locales
}
do_I2() { # Timezone
do_change_timezone() {
dpkg-reconfigure tzdata
}
@ -534,7 +534,12 @@ do_internationalisation_menu() {
if [ $RET -eq 1 ]; then
return 0
elif [ $RET -eq 0 ]; then
"do_$(echo $FUN | head -c 2)" || whiptail --msgbox "There was an error running option $FUN" 20 60 1
case "$FUN" in
I1\ *) do_change_locale ;;
I2\ *) do_change_timezone ;;
I3\ *) do_configure_keyboard ;;
*) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;;
esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1
fi
}