Ask for keyboard layout change (#139)

This commit is contained in:
Luis Guzman 2017-02-23 19:22:57 -06:00 committed by Daniel Hansson
parent 7de9dc0cd9
commit 339ea296f3
2 changed files with 35 additions and 15 deletions

View File

@ -507,13 +507,23 @@ clear
# Set keyboard layout
echo "Current keyboard layout is $(localectl status | grep "Layout" | awk '{print $3}')"
echo "You must change keyboard layout to your language"
echo -e "\e[32m"
read -p "Press any key to change keyboard layout... " -n1 -s
echo -e "\e[0m"
dpkg-reconfigure keyboard-configuration
echo
function ask_yes_or_no() {
read -p "$1 ([y]es or [N]o): "
case $(echo $REPLY | tr '[A-Z]' '[a-z]') in
y|yes) echo "yes" ;;
*) echo "no" ;;
esac
}
if [[ "no" == $(ask_yes_or_no "Do you want to change keyboard layout?") ]]
then
echo "Not changing keyboard layout..."
sleep 1
clear
else
dpkg-reconfigure keyboard-configuration
clear
fi
# Pretty URLs
echo "Setting RewriteBase to "/" in config.php..."
@ -657,9 +667,9 @@ clear
# Change password
echo -e "\e[0m"
echo "For better security, change the Linux password for [$UNIXUSER]"
echo "For better security, change the system user password for [$UNIXUSER]"
echo -e "\e[32m"
read -p "Press any key to change password for Linux... " -n1 -s
read -p "Press any key to change password for system user... " -n1 -s
echo -e "\e[0m"
sudo passwd $UNIXUSER
if [[ $? > 0 ]]

View File

@ -200,14 +200,24 @@ sudo mv sources.list /etc/apt/
clear
# Set keyboard layout
echo "Current keyboard layout is: $(localectl status | grep "Layout" | awk '{print $3}')"
echo "You must change keyboard layout to your language"
echo -e "\e[32m"
read -p "Press any key to change keyboard layout... " -n1 -s
echo -e "\e[0m"
dpkg-reconfigure keyboard-configuration
echo
echo "Current keyboard layout is $(localectl status | grep "Layout" | awk '{print $3}')"
function ask_yes_or_no() {
read -p "$1 ([y]es or [N]o): "
case $(echo $REPLY | tr '[A-Z]' '[a-z]') in
y|yes) echo "yes" ;;
*) echo "no" ;;
esac
}
if [[ "no" == $(ask_yes_or_no "Do you want to change keyboard layout?") ]]
then
echo "Not changing keyboard layout..."
sleep 1
clear
else
dpkg-reconfigure keyboard-configuration
clear
fi
# Update system
apt update -q2