Some newline logging stuff
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
#shellcheck shell=dash
|
||||
#
|
||||
|
||||
event_data=$(cat /tmp/es_state.inf)
|
||||
event_data=$(cat /tmp/es_state.inf | tr -d '\r' )
|
||||
|
||||
REMOTE_BASE="saves:gamepi-tv"
|
||||
PIPE="/tmp/savesync_pipe"
|
||||
@@ -14,11 +14,12 @@ log() {
|
||||
printf "LOG:[%s] %s\n" "$1" "$2" >"$PIPE"
|
||||
}
|
||||
|
||||
log "INFO" "Starting based on event"
|
||||
log "INFO" "Starting based on event: $(echo "$event_data" | tr '\n' ',')"
|
||||
|
||||
## Iterate over the data
|
||||
echo "$event_data" | while IFS='=' read -r key val; do
|
||||
# Split each pair into key and value using '=' as the delimiter
|
||||
echo "$event_data" | while IFS='=' read -r k v; do
|
||||
key=$(echo "$k" | tr -d '\n')
|
||||
val=$(echo "$v" | tr -d '\n')
|
||||
|
||||
# set variables and run functions based on the pairs
|
||||
case "$key" in
|
||||
@@ -40,7 +41,6 @@ echo "$event_data" | while IFS='=' read -r key val; do
|
||||
st="$val"
|
||||
log "DEBUG" "Setting st=$st"
|
||||
log "DEBUG" "Starting logic tree"
|
||||
|
||||
if [ "$st" = "playing" ] && [ "$act" = "rungame" ]; then
|
||||
log "INFO" "Sync START: $(basename "$gp")"
|
||||
remote_f="$REMOTE_BASE/$sid/$(basename "$sp")"
|
||||
|
||||
Reference in New Issue
Block a user