| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- #!/bin/bash
- # LinuxGSM command_dev_debug.sh module
- # Author: Daniel Gibbs
- # Contributors: http://linuxgsm.com/contrib
- # Website: https://linuxgsm.com
- # Description: Dev only: Enables debugging log to be saved to dev-debug.log.
- if [ -f "config" ]; then
- servercfgfullpath="config"
- fi
- if [ -f "clusterconfig" ]; then
- clustercfgfullpath="clusterconfig"
- fi
- info_game.sh
- carriagereturn=$(file -b "${servercfgfullpath}" | grep -q CRLF && echo "${red}CRLF${default}" || echo "${lightgreen}LF${default}")
- echo -e ""
- echo -e "${lightgreen}Server Details${default}"
- echo -e "=================================================================="
- echo -e ""
- echo -e "Game: ${gamename}"
- echo -e "Config type: ${configtype}"
- echo -e "Config file: ${servercfgfullpath}"
- if [ -f "${clustercfgfullpath}" ]; then
- echo -e "Cluster config file: ${clustercfgfullpath}"
- fi
- echo -e "Carriage Return: ${carriagereturn}"
- # Create an associative array of the server details.
- declare -A server_details=(
- ['Admin Password']="${adminpassword}"
- ['API Port']="${apiport}"
- ['Cave']="${cave}"
- ['Cluster']="${cluster}"
- ['Config IP']="${configip}"
- ['Default Map']="${defaultmap}"
- ['Game Mode']="${gamemode}"
- ['Game Type']="${gametype}"
- ['HTTP Enabled']="${httpenabled}"
- ['HTTP IP']="${httpip}"
- ['HTTP Password']="${httppassword}"
- ['HTTP Port']="${httpport}"
- ['HTTP User']="${httpuser}"
- ['ip']="${ip}"
- ['LAN Port']="${lanport}"
- ['Master Port']="${masterport}"
- ['Master']="${master}"
- ['Maxplayers']="${maxplayers}"
- ['OldQueryPortNumber']="${oldqueryportnumber}"
- ['Port']="${port}"
- ['Query Port']="${queryport}"
- ['RCON Enabled']="${rconenabled}"
- ['RCON Password']="${rconpassword}"
- ['RCON Port']="${rconport}"
- ['Reserved Slots']="${reservedslots}"
- ['Server Password']="${serverpassword}"
- ['Servername']="${servername}"
- ['Shard']="${shard}"
- ['Sharding']="${sharding}"
- ['Steam Auth Port']="${steamauthport}"
- ['Telnet IP']="${telnetip}"
- ['Tickrate']="${tickrate}"
- ['World Name']="${worldname}"
- ['World Type']="${worldtype}"
- )
- # Initialize a variable to keep track of missing server details.
- missing_details=""
- # Loop through the server details and output them.
- echo -e ""
- echo -e "${lightgreen}Available Server Details${default}"
- echo -e "================================="
- for key in "${!server_details[@]}"; do
- value=${server_details[$key]}
- if [ -z "$value" ]; then
- missing_details+="\n${key}"
- else
- echo -e "$key: $value "
- fi
- done
- # Output the missing server details if there are any.
- if [ -n "$missing_details" ]; then
- echo -e ""
- echo -e "${lightgreen}Missing Server Details${default}"
- echo -e "================================="
- echo -e "${missing_details}"
- fi
- core_exit.sh
|