Files
wakey/scripts/init/openwrt/update_wakey
T
2025-08-31 06:17:19 +07:00

24 lines
568 B
Bash

#!/bin/sh /etc/rc.common
START=66
start() {
LOGFILE=/var/log/update_wakey.log
MAX_RETRIES=10
RETRY_COUNT=0
# 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 &
}