Skip to content

Commit

Permalink
locale check simplified
Browse files Browse the repository at this point in the history
  • Loading branch information
lunardunno authored Feb 14, 2024
1 parent 03b5f84 commit cc8ce44
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions client/server_scripts/install_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,12 @@ elif which pacman > /dev/null 2>&1; then pm=$(which pacman); silent_inst="-S --n
else echo "Packet manager not found"; exit 1; fi;\
echo "Dist: $dist, Packet manager: $pm, Install command: $silent_inst, Check pkgs command: $check_pkgs, What pkg command: $what_pkg, Docker pkg: $docker_pkg";\
if [ "$dist" = "debian" ]; then export DEBIAN_FRONTEND=noninteractive; fi;\
CHECK_LOCALE=$(locale | grep -c 'LANG=en_US.UTF-8');\
if [ "$CHECK_LOCALE" = "0" ]; then \
CHECK_LOCALE=$(locale | grep -c 'LANG=C.UTF-8');\
if [ "$CHECK_LOCALE" = "0" ]; then \
CHECK_LOCALE=$(locale -a | grep -c 'en_US.utf8');\
if [ "$CHECK_LOCALE" != "0" ]; then export LC_ALL=en_US.UTF-8;\
else \
CHECK_LOCALE=$(locale -a | grep 'C.utf8');\
if [ "$CHECK_LOCALE" != "0" ]; then export LC_ALL=C.UTF-8; fi;\
fi;\
if [ "$(echo $LANG)" != "en_US.UTF-8" ] || [ "$(echo $LANG)" != "C.UTF-8" ]; then \
CHECK_LOCALES=$(locale -a | grep -c 'en_US.utf8');\
if [ "$CHECK_LOCALES" != "0" ]; then export LC_ALL=en_US.UTF-8;\
else \
CHECK_LOCALES=$(locale -a | grep 'C.utf8');\
if [ "$CHECK_LOCALES" != "0" ]; then export LC_ALL=C.UTF-8; fi;\
fi;\
fi;\
if ! command -v sudo > /dev/null 2>&1; then $pm $check_pkgs; $pm $silent_inst sudo;\
Expand Down

0 comments on commit cc8ce44

Please sign in to comment.