From 1f01b4e69a8f94918951fa681f547cb3e7238035 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Juri=C5=A1i=C4=87?= Date: Mon, 19 Feb 2024 13:16:25 +0100 Subject: [PATCH] Added Debian Settings for HR Locales --- debian/settings/set-hr-locales.sh | 44 +++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 debian/settings/set-hr-locales.sh 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 +