From 365b152ebf80a01cac33c3408e008f06ce288aed Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 19 Apr 2020 17:05:34 +0100 Subject: [PATCH] console message --- .../config-lgsm/arkserver/_default.cfg | 4 ++++ lgsm/functions/check.sh | 2 +- lgsm/functions/command_console.sh | 17 ++++++++++++++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/lgsm/config-default/config-lgsm/arkserver/_default.cfg b/lgsm/config-default/config-lgsm/arkserver/_default.cfg index 60061c177..a21dd59e1 100644 --- a/lgsm/config-default/config-lgsm/arkserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/arkserver/_default.cfg @@ -138,6 +138,10 @@ stopmode="2" querymode="2" querytype="protocol-valve" +## Console type +consoleoutput="off" +consoleverbose="off" + ## Game Server Details # Do not edit gamename="ARK: Survival Evolved" diff --git a/lgsm/functions/check.sh b/lgsm/functions/check.sh index 18d0fa262..fbb568887 100644 --- a/lgsm/functions/check.sh +++ b/lgsm/functions/check.sh @@ -44,7 +44,7 @@ if [ "$(whoami)" != "root" ]; then done fi -local allowed_commands_array=( command_backup.sh command_console.sh command_debug.sh command_details.sh command_unreal2_maps.sh command_fastdl.sh command_mods_install.sh command_mods_remove.sh command_mods_update.sh command_monitor.sh command_postdetails.sh command_restart.sh command_start.sh command_stop.sh command_test_alert.sh command_ts3_server_pass.sh command_update.sh command_update_functions.sh command_validate.sh command_wipe.sh command_unreal2_maps.sh command_ut99maps.sh) +local allowed_commands_array=( command_backup.sh command_console.sh command_debug.sh command_details.sh command_unreal2_maps.sh command_fastdl.sh command_mods_install.sh command_mods_remove.sh command_mods_update.sh command_monitor.sh command_postdetails.sh command_restart.sh command_start.sh command_stop.sh command_test_alert.sh command_ts3_server_pass.sh command_update.sh command_update_functions.sh command_validate.sh command_wipe.sh command_unreal2_maps.sh command_ut99maps.sh ) for allowed_command in "${allowed_commands_array[@]}" do if [ "${allowed_command}" == "${function_selfname}" ]; then diff --git a/lgsm/functions/command_console.sh b/lgsm/functions/command_console.sh index 16578600c..feb6bf3e5 100644 --- a/lgsm/functions/command_console.sh +++ b/lgsm/functions/command_console.sh @@ -10,13 +10,28 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" check.sh fn_print_header + +# Verbose output +if [ "${consoleverbose}" == "on" ]; then + fn_print_information_nl "${gamename} produces a verbose output to the console" +elif [ "${consoleverbose}" == "off" ]; then + fn_print_information_nl "${gamename} does NOT produce a verbose output to the console" +fi + +# Interactive console +if [ "${consolinteractive}" == "on" ]; then + fn_print_information_nl "${gamename} DOES allow server commands to be entered in to the console" +elif [ "${consolinteractive}" == "off" ]; then + fn_print_information_nl "${gamename} does NOT allow server commands to be entered in to the console" +fi + if [ "${shortname}" == "rust" ]||[ "${shortname}" == "hw" ]||[ "${shortname}" == "ark" ]; then fn_print_information_nl "${gamename} does not produce a verbose output to the console" fn_print_information_nl "${gamename} does not allow server commands to be entered in to the console" fi fn_print_information_nl "Press \"CTRL+b\" then \"d\" to exit console." fn_print_warning_nl "Do NOT press CTRL+c to exit." -echo -e " * https://docs.linuxgsm.com/commands/console" +echo -e "* https://docs.linuxgsm.com/commands/console" echo -e "" if ! fn_prompt_yn "Continue?" Y; then return