Update install.sh

This commit is contained in:
Arvin
2026-03-21 14:26:01 +08:00
parent 5636d9e41d
commit a55224b063

View File

@ -2,7 +2,7 @@
set -euo pipefail set -euo pipefail
Server_Dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" Server_Dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
Install_Dir="${CLASH_INSTALL_DIR:-/opt/clash-for-linux}" Install_Dir="${CLASH_INSTALL_DIR:-$Server_Dir}"
Service_Name="clash-for-linux" Service_Name="clash-for-linux"
Service_User="root" Service_User="root"
@ -26,15 +26,6 @@ fi
# ========================= # =========================
mkdir -p "$Install_Dir" mkdir -p "$Install_Dir"
if [ "$Server_Dir" != "$Install_Dir" ]; then
echo "[INFO] sync project to ${Install_Dir}"
if command -v rsync >/dev/null 2>&1; then
rsync -a --delete --exclude '.git' "$Server_Dir/" "$Install_Dir/"
else
cp -a "$Server_Dir/." "$Install_Dir/"
fi
fi
chmod +x "$Install_Dir"/clashctl 2>/dev/null || true chmod +x "$Install_Dir"/clashctl 2>/dev/null || true
chmod +x "$Install_Dir"/scripts/* 2>/dev/null || true chmod +x "$Install_Dir"/scripts/* 2>/dev/null || true
chmod +x "$Install_Dir"/bin/* 2>/dev/null || true chmod +x "$Install_Dir"/bin/* 2>/dev/null || true