This commit is contained in:
@@ -9,23 +9,22 @@
|
||||
|
||||
START=50 # Run before Tailscale (typically START~80)
|
||||
|
||||
start() {
|
||||
LOGFILE=/var/log/update_tailscale.log
|
||||
do_update() {
|
||||
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 &
|
||||
while [ "$RETRY_COUNT" -lt "$MAX_RETRIES" ]; do
|
||||
if /etc/ldlda_help/update_tailscale.sh; then
|
||||
echo "[update_tailscale] Success at $(date)"
|
||||
return 0
|
||||
fi
|
||||
RETRY_COUNT=$((RETRY_COUNT + 1))
|
||||
echo "[update_tailscale] Retry $RETRY_COUNT at $(date)"
|
||||
sleep 5
|
||||
done
|
||||
echo "[update_tailscale] Too many retries. Exiting at $(date)"
|
||||
return 1
|
||||
}
|
||||
|
||||
start() {
|
||||
do_update >> /var/log/update_tailscale.log 2>&1 &
|
||||
}
|
||||
|
||||
@@ -1,23 +1,24 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
START=66
|
||||
|
||||
start() {
|
||||
LOGFILE=/var/log/update_wakey.log
|
||||
# does this work now fam
|
||||
# exposal to wg is separate; so weon care
|
||||
do_update() {
|
||||
MAX_RETRIES=10
|
||||
RETRY_COUNT=0
|
||||
|
||||
# shellcheck disable=SC2016
|
||||
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 &
|
||||
while [ "$RETRY_COUNT" -lt "$MAX_RETRIES" ]; do
|
||||
if /etc/ldlda_help/update_wakey.sh; then
|
||||
echo "[update_wakey] Success at $(date)"
|
||||
return 0
|
||||
fi
|
||||
RETRY_COUNT=$((RETRY_COUNT + 1))
|
||||
echo "[update_wakey] Retry $RETRY_COUNT at $(date)"
|
||||
sleep 5
|
||||
done
|
||||
echo "[update_wakey] Too many retries. Exiting at $(date)"
|
||||
return 1
|
||||
}
|
||||
|
||||
start() {
|
||||
do_update >>/var/log/update_wakey.log 2>&1 &
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user