diff --git a/lgsm/functions/logs.sh b/lgsm/functions/logs.sh index 7d7dbcebe..927185ecf 100644 --- a/lgsm/functions/logs.sh +++ b/lgsm/functions/logs.sh @@ -67,7 +67,7 @@ if [ $(find "${lgsmlogdir}"/ -type f -mtime +"${logdays}"|wc -l) -ne "0" ]; then smcount=$(find "${commonlogs}"/ -type f -mtime +"${logdays}"|wc -l) find "${commonlogs}"/ -mtime +"${logdays}" -type f -exec rm -f {} \; fi - if [ -d ${commonsourcelogs} ]; then + if [ -d "${commonsourcelogs}" ]; then find "${commonsourcelogs}"/* -type f -mtime +"${logdays}"| tee >> "${lgsmlog}" smcount=$(find "${commonsourcelogs}"/* -type f -mtime +"${logdays}"|wc -l) find "${commonsourcelogs}"/* -mtime +"${logdays}" -type f -exec rm -f {} \; diff --git a/lgsm/functions/update_steamcmd.sh b/lgsm/functions/update_steamcmd.sh index ff9cd8672..c2c9fb608 100644 --- a/lgsm/functions/update_steamcmd.sh +++ b/lgsm/functions/update_steamcmd.sh @@ -102,7 +102,7 @@ fn_update_request_log(){ fn_print_dots "Checking for update: Server logs" fn_script_log_info "Checking for update: Server logs" sleep 1 - if [ -f ${consolelog} ]; then + if [ -f "${consolelog}" ]; then requestrestart=$(grep -Ec "MasterRequestRestart" "${consolelog}") else requestrestart="0" diff --git a/linuxgsm.sh b/linuxgsm.sh index da94afcde..7b5529854 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -23,8 +23,8 @@ fi version="170926" shortname="core" gameservername="core" -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +rootdir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" servicename="${selfname}" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" @@ -337,7 +337,7 @@ else echo -e "\e[0;32mOK\e[0m" fi else - function_file_diff=$(diff -q ${configdirdefault}/config-lgsm/${gameservername}/_default.cfg ${configdirserver}/_default.cfg) + function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") if [ "${function_file_diff}" != "" ]; then fn_print_warn_nl "_default.cfg has been altered. reloading config." echo -ne " copying _default.cfg...\c"