diff --git a/nextcloud-startup-script.sh b/nextcloud-startup-script.sh index 2dc3a8f1..e7f4f5fb 100644 --- a/nextcloud-startup-script.sh +++ b/nextcloud-startup-script.sh @@ -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 ]] diff --git a/nextcloud_install_production.sh b/nextcloud_install_production.sh index 6689c607..36408d5a 100644 --- a/nextcloud_install_production.sh +++ b/nextcloud_install_production.sh @@ -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