Compare commits

...

39 Commits

Author SHA1 Message Date
lunardunno
28907241df Merge branch '3rd_adaptation_to_diff_OS' into sudo_not_found 2024-02-14 06:50:34 +04:00
lunardunno
1aec417fc9 Merge pull request #588 from amnezia-vpn/test/docker-ce
Check which containerization application will be installed
2024-02-14 04:27:01 +04:00
lunardunno
fc0a9fd74f check and change locale
Checking and changing the locale for correct error handling by the server controller.
2024-02-14 03:46:03 +04:00
lunardunno
11fef3c653 checking of docker installation results 2024-02-14 03:39:07 +04:00
lunardunno
1226d1b287 Check moby and podman 2024-02-13 17:25:36 +04:00
lunardunno
1028f6998f docker-ce support
Implementation of docker-ce support, for Fedora and CentOS
2024-02-12 06:18:59 +04:00
lunardunno
c5afd4a85a checking_result_docker_installation 2023-12-15 05:30:13 +04:00
lunardunno
3289819673 rollback some changes 2023-11-30 15:31:32 +04:00
lunardunno
e80562c60f rollback servercontroller.cpp 2023-11-30 15:27:50 +04:00
lunardunno
a8b5601777 rollback check_server_is_busy.sh 2023-11-30 15:24:39 +04:00
lunardunno
fe50027edf remove exit 1 for check sudo 2023-11-30 15:10:47 +04:00
lunardunno
72beb609c4 some rollback 2023-11-30 14:50:21 +04:00
lunardunno
b934ff9437 Packet manager check for Install_docker.sh 2023-11-30 14:31:53 +04:00
lunardunno
9cbf62ae7a sudo not installed for check 2023-11-30 14:24:54 +04:00
lunardunno
c8e65abca0 check for sudo
check_server_is_busy.sh

check for sudo presence during execution check_server_is_busy.sh
2023-11-30 14:18:35 +04:00
lunardunno
ca3b1c9aba return exit 1 for sudo 2023-11-30 13:51:14 +04:00
lunardunno
e22e6e252b check sudo fuser lsof 2023-11-30 12:25:26 +04:00
lunardunno
9dd99f8080 checking of installation results psmisc 2023-11-30 11:22:49 +04:00
lunardunno
01fab70c14 back to basics 2023-11-30 01:28:55 +04:00
lunardunno
1c42e5e1b4 deleting " exit 1;" 2023-11-29 14:07:03 +04:00
lunardunno
0a564692ac re_some changes
adding " exit 1;"
2023-11-29 12:42:13 +04:00
lunardunno
075b83a990 some changes
adding " exit 1;"
2023-11-29 12:35:49 +04:00
lunardunno
f0adbfed67 test without sudo 2023-11-29 12:08:59 +04:00
lunardunno
06cbaa75c8 removed comment for sudo 2023-11-29 10:57:26 +04:00
lunardunno
5b29678348 some change
rearranging the message about the absence of sudo
2023-11-29 10:26:29 +04:00
lunardunno
63161df66b added comment for sudo
added a comment for the log when there is no sudo
2023-11-29 09:35:23 +04:00
lunardunno
b6467cc279 removing redundant line
removing a redundant line due to the introduction of direct verification of the installation result lsof, psmisc (fuser), sudo, docker|docker.io
2023-11-29 08:33:14 +04:00
lunardunno
e451862dd2 checking of installation results
Direct checking of installation results has been introduced for lsof psmisc sudo docker.
2023-11-28 19:23:19 +04:00
lunardunno
76f05da9c9 introduced direct check sudo
introduced a direct check for the presence of the sudo package, after attempting to install sudo
2023-11-27 15:40:33 +04:00
lunardunno
7f10a1349d fix then\ 2023-11-27 15:38:26 +04:00
lunardunno
b7fa882422 introduced direct check sudo
introduced a direct check for the presence of the sudo package, after attempting to install sudo
2023-11-27 15:29:58 +04:00
lunardunno
94effbd0b3 introduced sudo package check
indirect method, a check for the presence of the sudo package has been introduced
2023-11-27 12:10:50 +04:00
lunardunno
1f7714791e Improve end 2023-11-27 09:34:18 +04:00
lunardunno
b60d9639e9 introduction checking docker status 2023-11-26 07:57:22 +04:00
lunardunno
fcc7894527 replacing sudo with docker 2023-11-25 06:38:47 +04:00
lunardunno
cb2c4a7a3a fix premature script termination
Fix premature script termination for $dist=debian and $dist=centos.
Introduced for debugging $dist=fedora
2023-11-25 05:31:00 +04:00
lunardunno
4c1bada05d -sudo 2023-11-23 16:19:33 +04:00
lunardunno
8fd83f15e0 test sudo-test command not found 2023-11-23 15:49:06 +04:00
lunardunno
2d1b3e36f1 test sudo command not found 2023-11-23 12:48:18 +04:00

View File

@@ -1,20 +1,43 @@
if which apt-get > /dev/null 2>&1; then pm=$(which apt-get); silent_inst="-yq install"; check_pkgs="-yq update"; docker_pkg="docker.io"; dist="debian";\
elif which dnf > /dev/null 2>&1; then pm=$(which dnf); silent_inst="-yq install"; check_pkgs="-yq check-update"; docker_pkg="docker"; dist="fedora";\
elif which yum > /dev/null 2>&1; then pm=$(which yum); silent_inst="-y -q install"; check_pkgs="-y -q check-update"; docker_pkg="docker"; dist="centos";\
elif which pacman > /dev/null 2>&1; then pm=$(which pacman); silent_inst="-S --noconfirm --noprogressbar --quiet"; check_pkgs="> /dev/null 2>&1"; docker_pkg="docker"; dist="archlinux";\
if which apt-get > /dev/null 2>&1; then pm=$(which apt-get); silent_inst="-yq install"; check_pkgs="-yq update"; what_pkg="-s install"; docker_pkg="docker.io"; dist="debian";\
elif which dnf > /dev/null 2>&1; then pm=$(which dnf); silent_inst="-yq install"; check_pkgs="-yq check-update"; what_pkg="--assumeno install --setopt=tsflags=test"; docker_pkg="docker"; dist="fedora";\
elif which yum > /dev/null 2>&1; then pm=$(which yum); silent_inst="-y -q install"; check_pkgs="-y -q check-update"; what_pkg="--assumeno install --setopt=tsflags=test"; docker_pkg="docker"; dist="centos";\
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, Docker pkg: $docker_pkg";\
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 ! 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;\
if ! command -v lsof > /dev/null 2>&1; then sudo $pm $check_pkgs; sudo $pm $silent_inst lsof; fi;\
if ! command -v docker > /dev/null 2>&1; then \
sudo $pm $check_pkgs; sudo $pm $silent_inst $docker_pkg;\
sleep 5; sudo systemctl enable --now docker; sleep 5;\
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;\
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;\
fi;\
if ! command -v fuser > /dev/null 2>&1; then sudo $pm $check_pkgs; sudo $pm $silent_inst psmisc;\
if ! command -v fuser > /dev/null 2>&1; then fuser; exit 1; fi;\
fi;\
if ! command -v lsof > /dev/null 2>&1; then sudo $pm $check_pkgs; sudo $pm $silent_inst lsof;\
if ! command -v lsof > /dev/null 2>&1; then lsof; exit 1; fi;\
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;\
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;\
fi;\
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;\
fi;\
if ! command -v sudo > /dev/null 2>&1; then echo "Failed to install sudo, command not found"; exit 1; fi;\
if ! command -v docker > /dev/null 2>&1; then echo "Failed to install docker, command not found"; exit 1; fi;\
docker --version