Files
wakey/scripts/init/openwrt/update_tailscale
T
lda b0d0bbf015 Squashed commit of the following:
commit 84ac271bbb
Author: lda <[email protected]>
Date:   Fri Nov 21 00:56:02 2025 +0700

    six

commit 723b232123
Author: lda <[email protected]>
Date:   Fri Nov 21 00:50:24 2025 +0700

    expose the files, fmt

    now i can see what macs my computer is

commit aab791eb5d
Author: lda <[email protected]>
Date:   Fri Nov 21 00:38:37 2025 +0700

    uh what

commit 1dc598b262
Author: lda <[email protected]>
Date:   Tue Oct 21 01:10:19 2025 +0700

    the commit of cherrypicking

    d7c34ee
2025-11-21 01:02:32 +07:00

32 lines
824 B
Bash

#!/bin/sh /etc/rc.common
# Simple helper to update tailscale before its own init runs
# Provides: update_tailscale
# Required-Start: $network
# Required-Stop:
# Default-Start: S # earliest boot stage
# Default-Stop:
# Short-Description: Pre-flight Tailscale update
START=50 # Run before Tailscale (typically START~80)
start() {
LOGFILE=/var/log/update_tailscale.log
MAX_RETRIES=10
RETRY_COUNT=0
# shellcheck disable=SC2016
sh -c '
while [ "$RETRY_COUNT" -lt "$MAX_RETRIES" ]; do
if fn; then
echo "[update_tailscale] Success at $(date)" >>"$LOGFILE"
exit 0
fi
RETRY_COUNT=$((RETRY_COUNT + 1))
echo "[update_tailscale] Retry $RETRY_COUNT at $(date)" >>"$LOGFILE"
sleep 5
done
echo "[update_tailscale] Too many retries. Exiting at $(date)" >>"$LOGFILE"
exit 1
' >>"$LOGFILE" 2>&1 &
}