Compare commits

..

1 Commits

Author SHA1 Message Date
vkamn 47832e888c feat: add fallback proxy endpoint 2026-04-21 16:40:22 +08:00
3 changed files with 1 additions and 7 deletions
@@ -3,7 +3,5 @@ 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
@@ -3,8 +3,6 @@ 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/.*\///');\
+1 -3
View File
@@ -3,8 +3,6 @@ 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;\
@@ -18,7 +16,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 [ "$(ls /var/run/docker.sock)" != "/var/run/docker.sock" ]; then \
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;\