Fix RCON. Usage: dz n command, where command is a valid RCON command, e.g. players

This commit is contained in:
Daniel Ceregatti 2025-10-14 12:33:51 -06:00
parent 247612f32d
commit 4e9a93ba53

View file

@ -26,6 +26,7 @@ then
mkdir -p "${BACKUP_DIR}" mkdir -p "${BACKUP_DIR}"
fi fi
RCON_PASSWORD=""
mod_command_line="" mod_command_line=""
server_command_line="" server_command_line=""
@ -101,7 +102,7 @@ EOF
then then
FILE="${ALT_BE_SERVER_FILE}" FILE="${ALT_BE_SERVER_FILE}"
fi fi
passwd=$(grep RConPassword ${FILE} | awk '{print $2}') RCON_PASSWORD=$(grep RConPassword ${FILE} | awk '{print $2}')
# printf "[ ${cyan}INFO${default} ] Using existing RCON password: ${yellow}${passwd}${default}\n" # printf "[ ${cyan}INFO${default} ] Using existing RCON password: ${yellow}${passwd}${default}\n"
fi fi
} }
@ -636,6 +637,12 @@ wipe(){
fi fi
} }
rcon(){
loadconfig
bercon-cli -p${RCON_PORT} -P${RCON_PASSWORD} $*
echo
}
MAP=$(get_map_name) MAP=$(get_map_name)
# Capture the first argument and shift it off so we can pass $@ to every function # Capture the first argument and shift it off so we can pass $@ to every function