From ed90151a241d4a68e0a28425435f787e1df4ef4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asger=20Weirs=C3=B8e?= Date: Wed, 27 May 2026 15:21:02 +0200 Subject: [PATCH] setup-container: chmod the binary and improve missing-binary hint When downloading a release asset over HTTP the executable bit is lost, so checking '-x' would always fail. Check existence instead and chmod unconditionally. Update the error message to cover the three common install paths. --- lxc/setup-container.sh | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/lxc/setup-container.sh b/lxc/setup-container.sh index 7a0b946..e26d6c7 100644 --- a/lxc/setup-container.sh +++ b/lxc/setup-container.sh @@ -30,11 +30,26 @@ if ! command -v microsocks >/dev/null 2>&1; then rm -rf "$tmp" fi -# 3. Install fetch-service binary (forventes pushet ind af host-scriptet) -if [[ ! -x /usr/local/bin/weircon-random-proxy ]]; then - echo "ERR: /usr/local/bin/weircon-random-proxy mangler — push den fra host'en først" >&2 +# 3. Install fetch-service binary. +# Forventes pushet/lagt på plads af brugeren før dette script køres +# (enten via `pct push` fra Proxmox-hosten, eller lokalt med `cp`). +BIN=/usr/local/bin/weircon-random-proxy +if [[ ! -f "$BIN" ]]; then + cat >&2 < ./weircon-random-proxy $BIN --perms 0755 + - fra inde i LXC: cp /path/to/weircon-random-proxy $BIN + chmod +x $BIN + - download release: curl -fLo $BIN https:////weircon-random-proxy/releases/download//weircon-random-proxy + chmod +x $BIN + +Kør derefter setup-container.sh igen. +EOF exit 1 fi +chmod +x "$BIN" # 4. Helper-scripts install -Dm755 "$SCRIPT_DIR/netns-up.sh" /usr/local/sbin/weircon-netns-up