fix: use -x file test instead of command -v for tailscale binaries
SRM default PATH is /usr/bin:/bin:/usr/sbin:/sbin:/usr/syno/bin — /usr/local/bin is NOT included. 'command -v /usr/local/bin/tailscaled' fails on busybox ash even when the file exists and is executable. Replaced with '[ ! -x "$BIN" ]' which is always reliable for absolute paths. Found during x5925 deployment testing. Daemon logged 'binary not found' despite the files being present at /usr/local/bin/tailscale[d]. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -61,10 +61,14 @@ start_tailscale() {
|
||||
[ "$TAILSCALE_ENABLE" != "1" ] && { log "tailscale: disabled in config"; return 0; }
|
||||
[ -z "$TAILSCALE_AUTH_KEY" ] && { log "tailscale: no auth key — skipping"; return 0; }
|
||||
|
||||
if ! command -v "$TAILSCALED_BIN" >/dev/null 2>&1; then
|
||||
log "tailscale: binary not found at $TAILSCALED_BIN"
|
||||
return 1
|
||||
fi
|
||||
if [ ! -x "$TAILSCALED_BIN" ]; then
|
||||
log "tailscale: tailscaled not found at $TAILSCALED_BIN (SRM PATH lacks /usr/local/bin)"
|
||||
return 1
|
||||
fi
|
||||
if [ ! -x "$TAILSCALE_BIN" ]; then
|
||||
log "tailscale: binary not found at $TAILSCALE_BIN"
|
||||
return 1
|
||||
fi
|
||||
|
||||
mkdir -p "$(dirname "$TAILSCALE_STATEDIR")" "$(dirname "$TAILSCALE_SOCKET")"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user