Compare commits

...

5 Commits

Author SHA1 Message Date
lunardunno
b9254e5100 Check user in sudo for apk and opkg 2026-04-26 04:11:51 +04:00
lunardunno
15dd62a7bb Checking server is busy for OPKG 2026-04-26 03:52:57 +04:00
lunardunno
dfc615c36a Another way to check the service status. 2026-04-26 03:42:25 +04:00
lunardunno
848e4d7c6f Checking server is busy for APK 2026-04-26 01:49:52 +04:00
lunardunno
739b2a575d Adding APK support 2026-04-26 00:35:49 +04:00
3 changed files with 7 additions and 1 deletions

View File

@@ -3,5 +3,7 @@ elif which dnf > /dev/null 2>&1; then LOCK_CMD="fuser"; LOCK_FILE="/var/cache/dn
elif which yum > /dev/null 2>&1; then LOCK_CMD="cat"; LOCK_FILE="/var/run/yum.pid";\
elif which zypper > /dev/null 2>&1; then LOCK_CMD="cat"; LOCK_FILE="/var/run/zypp.pid";\
elif which pacman > /dev/null 2>&1; then LOCK_CMD="fuser"; LOCK_FILE="/var/lib/pacman/db.lck";\
elif which apk > /dev/null 2>&1; then LOCK_CMD="pgrep"; LOCK_FILE="apk";\
elif which opkg > /dev/null 2>&1; then LOCK_CMD="pgrep"; LOCK_FILE="opkg";\
else echo "Packet manager not found"; echo "Internal error"; exit 1; fi;\
if command -v $LOCK_CMD > /dev/null 2>&1; then sudo $LOCK_CMD $LOCK_FILE 2>/dev/null; else echo "$LOCK_CMD not installed"; fi

View File

@@ -3,6 +3,8 @@ elif which dnf > /dev/null 2>&1; then pm=$(which dnf); opt="--version";\
elif which yum > /dev/null 2>&1; then pm=$(which yum); opt="--version";\
elif which zypper > /dev/null 2>&1; then pm=$(which zypper); opt="--version";\
elif which pacman > /dev/null 2>&1; then pm=$(which pacman); opt="--version";\
elif which apk > /dev/null 2>&1; then pm=$(which apk); opt="--version";\
elif which opkg > /dev/null 2>&1; then pm=$(which opkg); opt="--version";\
else pm="uname"; opt="-a";\
fi;\
CUR_USER=$(whoami 2>/dev/null || echo $HOME | sed 's/.*\///');\

View File

@@ -3,6 +3,8 @@ elif which dnf > /dev/null 2>&1; then pm=$(which dnf); silent_inst="-yq install"
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 zypper > /dev/null 2>&1; then pm=$(which zypper); silent_inst="-nq install"; check_pkgs="-nq refresh"; docker_pkg="docker"; dist="opensuse";\
elif which pacman > /dev/null 2>&1; then pm=$(which pacman); silent_inst="-S --noconfirm --noprogressbar --quiet"; check_pkgs="-Sup"; docker_pkg="docker"; dist="archlinux";\
elif which apk > /dev/null 2>&1; then pm=$(which apk); silent_inst="add"; check_pkgs="update"; docker_pkg="docker dockerd"; dist="alpine";\
elif which opkg > /dev/null 2>&1; then pm=$(which opkg); silent_inst="install"; check_pkgs="update"; docker_pkg="docker dockerd"; dist="entware";\
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";\
if [ "$dist" = "debian" ]; then export DEBIAN_FRONTEND=noninteractive; fi;\
@@ -16,7 +18,7 @@ fi;\
if [ "$(cat /sys/module/apparmor/parameters/enabled 2>/dev/null)" = "Y" ]; then \
if ! command -v apparmor_parser > /dev/null 2>&1; then sudo $pm $check_pkgs; sudo $pm $silent_inst apparmor; fi;\
fi;\
if [ "$(systemctl is-active docker)" != "active" ]; then \
if [ "$(ls /var/run/docker.sock)" != "/var/run/docker.sock" ]; then \
sudo $pm $check_pkgs; sudo $pm $silent_inst $docker_pkg;\
sleep 5; sudo systemctl start docker; sleep 5;\
fi;\