From 6a7ad3db7f38116483ff48f771b06522fad03778 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 4 May 2017 23:03:30 +0100 Subject: [PATCH] filesdir is now serverfiles --- lgsm/functions/alert_email.sh | 2 +- lgsm/functions/check_system_dir.sh | 15 +++++++++++---- lgsm/functions/command_details.sh | 2 +- lgsm/functions/info_distro.sh | 6 +++--- lgsm/functions/install_server_files.sh | 4 ++-- tests/tests_jc2server.sh | 2 +- tests/tests_ts3server.sh | 2 +- 7 files changed, 20 insertions(+), 13 deletions(-) diff --git a/lgsm/functions/alert_email.sh b/lgsm/functions/alert_email.sh index a49dda347..36541706d 100644 --- a/lgsm/functions/alert_email.sh +++ b/lgsm/functions/alert_email.sh @@ -83,7 +83,7 @@ fn_details_disk(){ echo -e "Total: ${totalspace}" echo -e "Used: ${usedspace}" echo -e "Available: ${availspace}" - echo -e "Serverfiles: ${filesdirdu}" + echo -e "Serverfiles: ${serverfilesdu}" if [ -d "${backupdir}" ]; then echo -e "Backups: ${backupdirdu}" fi diff --git a/lgsm/functions/check_system_dir.sh b/lgsm/functions/check_system_dir.sh index 0e5c39718..c08fb33a7 100644 --- a/lgsm/functions/check_system_dir.sh +++ b/lgsm/functions/check_system_dir.sh @@ -2,15 +2,22 @@ # LinuxGSM check_system_dir.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: Checks if systemdir is accessible. +# Description: Checks if systemdir/serverfiles is accessible. local commandname="CHECK" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -if [ ! -d "${systemdir}" ]; then - fn_print_fail_nl "Cannot access ${systemdir}: No such directory" +if [ "${function_selfname}" != "command_validate.sh" ];then + checkdir="${serverfiles}" +else + checkdir="${systemdir}" +fi + +if [ ! -d "${checkdir}" ]; then + fn_print_fail_nl "Cannot access ${checkdir}: No such directory" if [ -d "${scriptlogdir}" ]; then - fn_script_log_fatal "Cannot access ${systemdir}: No such directory." + fn_script_log_fatal "Cannot access ${checkdir}: No such directory." fi core_exit.sh fi + diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh index 106eb0041..843b09eaf 100644 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -83,7 +83,7 @@ fn_details_disk(){ echo -e "${blue}Used:\t${default}${usedspace}" echo -e "${blue}Available:\t${default}${availspace}" echo -e "${blue}LinuxGSM Total:\t${default}${rootdirdu}" - echo -e "${blue}Serverfiles:\t${default}${filesdirdu}" + echo -e "${blue}Serverfiles:\t${default}${serverfilesdu}" if [ -d "${backupdir}" ]; then echo -e "${blue}Backups:\t${default}${backupdirdu}" fi diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index c83dff8a1..d85d89fb6 100644 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -95,9 +95,9 @@ if [ -z "${rootdirdu}" ]; then fi ## LinuxGSM used space in serverfiles dir. -filesdirdu=$(du -sh "${serverfiles}" 2> /dev/null | awk '{print $1}') -if [ -z "${filesdirdu}" ]; then - filesdirdu="0M" +serverfilesdu=$(du -sh "${serverfiles}" 2> /dev/null | awk '{print $1}') +if [ -z "${serverfilesdu}" ]; then + serverfilesdu="0M" fi ## LinuxGSM used space total minus backup dir. diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh index 636f0dea5..916c3fbb8 100644 --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/functions/install_server_files.sh @@ -86,10 +86,10 @@ fn_install_server_files_steamcmd(){ fi elif [ "${counter}" -ge "5" ]; then if [ "${engine}" == "goldsource" ]; then - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${branch} -validate +quit + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${branch} validate +quit local exitcode=$? else - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" ${branch} -validate +quit + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" ${branch} validate +quit local exitcode=$? fi fi diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index ae554e85a..edfeb983d 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -90,7 +90,7 @@ lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" libdir="${lgsmdir}/lib" tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" +serverfiles="${rootdir}/serverfiles" ## Server Specific Directories systemdir="${serverfiles}" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index d19223269..308c59a57 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -77,7 +77,7 @@ lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" libdir="${lgsmdir}/lib" tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" +serverfiles="${rootdir}/serverfiles" ## Server Specific Directories systemdir="${serverfiles}"