Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interpret backslash escapes for RCON_CMDS #3008

Merged
merged 1 commit into from
Jul 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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