From 7a466ac836cf414ba5505615282080867c5fc0f0 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Mon, 5 Oct 2020 02:51:48 +0000 Subject: [PATCH] force utf8 locale to prevent json decode errors with postgres --- install.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 4aad8d4c..5a8b3209 100755 --- a/install.sh +++ b/install.sh @@ -1,11 +1,12 @@ #!/bin/bash -SCRIPT_VERSION="9" +SCRIPT_VERSION="10" SCRIPT_URL='https://raw.githubusercontent.com/wh1te909/tacticalrmm/develop/install.sh' GREEN='\033[0;32m' YELLOW='\033[1;33m' BLUE='\033[0;34m' +RED='\033[0;31m' NC='\033[0m' TMP_FILE=$(mktemp -p "" "rmminstall_XXXXXXXXXX") @@ -32,6 +33,13 @@ if [ $EUID -eq 0 ]; then exit 1 fi +if [ "$LANG" != "en_US.UTF-8" ]; then + printf >&2 "\n${RED}System locale must be ${GREEN}en_US.UTF-8${RED} not ${YELLOW}${LANG}${NC}\n" + printf >&2 "${RED}Run the following command and change the default locale to ${GREEN}en_US.UTF-8${NC}\n\n" + printf >&2 "${GREEN}sudo dpkg-reconfigure locales${NC}\n\n" + printf >&2 "${RED}You will need to log out and back in for changes to take effect, then re-run this script.${NC}\n\n" +fi + # prevents logging issues with some VPS providers like Vultr if this is a freshly provisioned instance that hasn't been rebooted yet sudo systemctl restart systemd-journald.service