diff --git a/debian/settings/set-hr-locales.sh b/debian/settings/set-hr-locales.sh new file mode 100755 index 0000000..966f971 --- /dev/null +++ b/debian/settings/set-hr-locales.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +#### Functions +check_root() { + if [ "$EUID" -ne 0 ]; then + echo "Must be root to run $0" + exit + fi +} + +choice() { + echo -ne "[y/n]" + while true + do + read -rN1 input + case $input in + [yY][eE][sS]|[yY]) + return 0 + + break + ;; + [nN][oO]|[nN]) + return 1 + ;; + esac + done +} + +#### Main + +check_root + +echo -ne "\nSet Croatian Time,Numeric,Collate and Monetary Locales ? " +if choice 2>/dev/null; then + sed -i -e 's/# hr_HR.UTF-8 UTF-8/hr_HR.UTF-8 UTF-8/g' /etc/locale.gen + locale-gen + update-locale LC_TIME=\"hr_HR.UTF-8\" + update-locale LC_NUMERIC=\"hr_HR.UTF-8\" + update-locale LC_COLLATE=\"hr_HR.UTF-8\" + update-locale LC_MONETARY=\"hr_HR.UTF-8\" + + echo -ne "\nPlease reboot system\n" +fi +