Skip to content

Commit

Permalink
Interpret backslash escapes for RCON_CMDS (#3008)
Browse files Browse the repository at this point in the history
  • Loading branch information
quulah authored Jul 21, 2024
1 parent d7c6a7d commit b393b22
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bin/rcon-cmds-daemon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ do
if [[ "$RCON_CMDS_STARTUP" ]]; then
while read -r cmd; do
run_command "$cmd"
done <<< "$RCON_CMDS_STARTUP"
done <<< "$(echo -e "$RCON_CMDS_STARTUP")"
fi
if
[[ -z "$RCON_CMDS_ON_CONNECT" ]] &&
Expand All @@ -66,21 +66,21 @@ do
logRcon "First Clients has Connected, running first connect cmds"
while read -r cmd; do
run_command "$cmd"
done <<< "$RCON_CMDS_FIRST_CONNECT"
done <<< "$(echo -e "$RCON_CMDS_FIRST_CONNECT")"
fi

# When a client joins
if (( CURR_CLIENTCONNECTIONS > CLIENTCONNECTIONS )) && [[ "$RCON_CMDS_ON_CONNECT" ]]; then
logRcon "Clients have Connected, running connect cmds"
while read -r cmd; do
run_command "$cmd"
done <<< "$RCON_CMDS_ON_CONNECT"
done <<< "$(echo -e "$RCON_CMDS_ON_CONNECT")"
# When a client leaves
elif (( CURR_CLIENTCONNECTIONS < CLIENTCONNECTIONS )) && [[ "$RCON_CMDS_ON_DISCONNECT" ]]; then
logRcon "Clients have Disconnected, running disconnect cmds"
while read -r cmd; do
run_command "$cmd"
done <<< "$RCON_CMDS_ON_DISCONNECT"
done <<< "$(echo -e "$RCON_CMDS_ON_DISCONNECT")"
fi

# Last client connection
Expand All @@ -89,7 +89,7 @@ do
logRcon "ALL Clients have Disconnected, running last disconnect cmds"
while read -r cmd; do
run_command "$cmd"
done <<< "$RCON_CMDS_LAST_DISCONNECT"
done <<< "$(echo -e "$RCON_CMDS_LAST_DISCONNECT")"
fi
CLIENTCONNECTIONS=$CURR_CLIENTCONNECTIONS
;;
Expand Down

0 comments on commit b393b22

Please sign in to comment.