Skip to content

Commit

Permalink
force C.UTF-8 assignment
Browse files Browse the repository at this point in the history
Force C.UTF-8 if the system language is other than en_US.
Temporary simplification of script stopping for moby and podman.
Stop script execution if Docker is not active.
  • Loading branch information
lunardunno authored Feb 14, 2024
1 parent cc8ce44 commit 6dceb3d
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions client/server_scripts/install_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@ 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;\
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;\
if [ "$(echo $LANG)" != "en_US.UTF-8" ] && [ "$(echo $LANG)" != "C.UTF-8" ]; then \
if [ "$(locale -a | grep -c 'en_US.utf8')" != "0" ]; then export LC_ALL=en_US.UTF-8;\
else export LC_ALL=C.UTF-8; fi;\
fi;\
if ! command -v sudo > /dev/null 2>&1; then $pm $check_pkgs; $pm $silent_inst sudo;\
if ! command -v sudo > /dev/null 2>&1; then sudo; exit 1; fi;\
Expand All @@ -25,7 +21,7 @@ fi;\
if ! command -v docker > /dev/null 2>&1; then sudo $pm $check_pkgs;\
check_podman=$(sudo $pm $what_pkg $docker_pkg 2>&1 | grep -c podman-docker);\
check_moby=$(sudo $pm $what_pkg $docker_pkg 2>&1 | grep -c moby-engine);\
if [ "$check_podman" != "0" ] || [ "$check_moby" != "0" ]; then echo "Container is not supported"; exit 1;\
if [ "$check_podman" != "0" ] || [ "$check_moby" != "0" ]; then echo "Docker is not supported"; docker; exit 1;\
else sudo $pm $silent_inst $docker_pkg;\
if ! command -v docker > /dev/null 2>&1; then docker; exit 1;\
else sleep 5; sudo systemctl enable --now docker; sleep 5; fi;\
Expand All @@ -34,6 +30,6 @@ fi;\
if [ "$(systemctl is-active docker)" != "active" ]; then \
sudo $pm $check_pkgs; sudo $pm $silent_inst $docker_pkg;\
sleep 5; sudo systemctl start docker; sleep 5;\
if [ "$(systemctl is-active docker)" != "active" ]; then echo "Failed to status docker, command not found"; fi;\
fi;\
if ! command -v docker > /dev/null 2>&1; then echo "Failed to install docker, command not found"; exit 1; fi;\
docker --version

0 comments on commit 6dceb3d

Please sign in to comment.