Back to basics

This commit is contained in:
2026-02-28 00:07:56 -06:00
parent 2952bd6c33
commit 6153efb3dd
4 changed files with 83 additions and 81 deletions

View File

@@ -0,0 +1,25 @@
#!/bin/ash
# shellcheck shell=dash
export LOG_FILE="/recalbox/share/system/logs/savesync.log"
export PIPE="/tmp/savesync_pipe"
# Setup the pipe if it doesn't exist
[ -p "$PIPE" ] || mkfifo "$PIPE"
chmod 666 "$PIPE"
write_log() {
printf "[%s] %s\n" "$(date '+%Y-%m-%d %H:%M:%S')" "$1" >>"$LOG_FILE"
}
write_log "--- Logger Started ---"
while true; do
# Read one line from the pipe
if read -r line <"$PIPE"; then
case "$line" in
LOG:*)
write_log "${line#LOG:}"
;;
esac
fi
done