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

This commit is contained in:
lda committed 2025-08-31 06:17:19 +07:00
1 parent 1a94cdb32c
commit cc7f8013ad
2 files changed
+36 -24

No files matched your search

+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 &
}