quit using bullshit tools for non bullshit problems
release / build (push) Successful in 43s

This commit is contained in:
lda
2025-08-31 06:17:19 +07:00 Unverified
parent 1a94cdb32c
commit cc7f8013ad
2 changed files with 36 additions and 24 deletions
+18 -12
View File
@@ -8,18 +8,24 @@
# Short-Description: Pre-flight Tailscale update
START=50 # Run before Tailscale (typically START~80)
USE_PROCD=1
start_service() {
procd_open_instance
procd_set_param command /bin/sh -c \
'while ! /etc/ldlda_help/update_tailscale.sh; do sleep 5; done'
procd_set_param respawn 9999 15 1
procd_set_param stdout 1
procd_set_param stderr 1
procd_close_instance
}
start() {
LOGFILE=/var/log/update_tailscale.log
MAX_RETRIES=10
RETRY_COUNT=0
stop_service() {
: # one-shot
# shellcheck disable=SC2016
nohup 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 &
}
+18 -12
View File
@@ -1,17 +1,23 @@
#!/bin/sh /etc/rc.common
START=66
USE_PROCD=1
start_service() {
procd_open_instance
procd_set_param command /bin/sh -c \
'while ! /etc/ldlda_help/update_wakey.sh; do sleep 5; done'
procd_set_param respawn 9999 15 1
procd_set_param stdout 1
procd_set_param stderr 1
procd_close_instance
}
start() {
LOGFILE=/var/log/update_wakey.log
MAX_RETRIES=10
RETRY_COUNT=0
stop_service() {
: # no-op
# shellcheck disable=SC2016
nohup sh -c '
while [ "$RETRY_COUNT" -lt "$MAX_RETRIES" ]; do
if /etc/ldlda_help/update_wakey.sh; then
echo "[update_wakey] Success at $(date)" >>"$LOGFILE"
exit 0
fi
RETRY_COUNT=$((RETRY_COUNT + 1))
echo "[update_wakey] Retry $RETRY_COUNT at $(date)" >>"$LOGFILE"
sleep 5
done
echo "[update_wakey] Too many retries. Exiting at $(date)" >>"$LOGFILE"
exit 1
' >>"$LOGFILE" 2>&1 &
}