fix: add build-time binary search + runtime path-finder for purevpn-cli

This commit is contained in:
2026-03-11 10:08:44 +01:00
parent fa5918a36d
commit ed4076abca
2 changed files with 20 additions and 1 deletions

View File

@@ -6,6 +6,21 @@ set -euo pipefail
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/etc/pure-linux-cli/
# ── Locate purevpn-cli wherever the installer put it ─────────────────────────
if ! command -v purevpn-cli &>/dev/null; then
_bin=$(find / -maxdepth 8 -name "purevpn-cli" -type f 2>/dev/null | head -1)
if [[ -n "$_bin" ]]; then
export PATH="$(dirname "$_bin"):$PATH"
echo "[entrypoint] purevpn-cli found at $_bin — PATH updated"
else
echo "[entrypoint] FATAL: purevpn-cli not found anywhere on the filesystem"
echo "[entrypoint] All purevpn* files:"
find / -maxdepth 8 -name "purevpn*" 2>/dev/null || true
exit 1
fi
fi
echo "[entrypoint] Using purevpn-cli: $(command -v purevpn-cli)"
SOCKS5_PORT="${SOCKS5_INNER_PORT:-1080}"
VPN_IF="tun0"
VPN_WAIT=60 # max seconds to wait for tun0 to appear