Checking docker status

Checking Docker activity.
Checking and changing locale.
Changing "command not found" handling for sh compatibility.
This commit is contained in:
lunardunno 2025-04-07 14:16:07 +04:00
parent 8331b9ea52
commit 5c494fa743
4 changed files with 9 additions and 2 deletions

View file

@ -4,6 +4,7 @@ elif which yum > /dev/null 2>&1; then pm=$(which yum); silent_inst="-y -q instal
elif which pacman > /dev/null 2>&1; then pm=$(which pacman); silent_inst="-S --noconfirm --noprogressbar --quiet"; check_pkgs="-Sup"; what_pkg="-Sp"; docker_pkg="docker"; dist="archlinux";\
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";\
echo $LANG | grep -qE '^(en_US.UTF-8|C.UTF-8|C)$' || export LC_ALL=C;\
if [ "$dist" = "debian" ]; then export DEBIAN_FRONTEND=noninteractive; fi;\
if ! command -v sudo > /dev/null 2>&1; then $pm $check_pkgs; $pm $silent_inst sudo; fi;\
if ! command -v fuser > /dev/null 2>&1; then sudo $pm $check_pkgs; sudo $pm $silent_inst psmisc; fi;\
@ -27,8 +28,10 @@ if [ "$(systemctl is-active docker)" != "active" ]; then \
then sudo $pm $silent_inst $docker_pkg;\
fi;\
sleep 5; sudo systemctl start docker; sleep 5;\
if [ "$(systemctl is-active docker)" != "active" ];\
then echo "Status Docker is not active";\
fi;\
else echo "Podman is not supported";\
fi;\
fi;\
if ! command -v sudo > /dev/null 2>&1; then echo "Failed to install sudo, command not found"; exit 1; fi;\
sudo docker --version