From b79819b96896c49f5a7969ba9b2068e1f1dd0ecf Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 17 Mar 2018 00:41:21 +0000 Subject: [PATCH 1/8] SC2129 --- lgsm/functions/install_ts3db.sh | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/lgsm/functions/install_ts3db.sh b/lgsm/functions/install_ts3db.sh index 1509c8f62..fc200fa79 100644 --- a/lgsm/functions/install_ts3db.sh +++ b/lgsm/functions/install_ts3db.sh @@ -26,19 +26,21 @@ fn_install_ts3db_mariadb(){ echo "Configuring ${gamename} Server for MariaDB/MySQL" echo "=================================" sleep 1 - read -p "Enter MariaDB hostname: " mariahostname - read -p "Enter MariaDB port: " mariaport - read -p "Enter MariaDB username: " mariausername - read -p "Enter MariaDB password: " mariapassword - read -p "Enter MariaDB database name: " mariadbname + read -rp "Enter MariaDB hostname: " mariahostname + read -rp "Enter MariaDB port: " mariaport + read -rp "Enter MariaDB username: " mariausername + read -rp "Enter MariaDB password: " mariapassword + read -rp "Enter MariaDB database name: " mariadbname + { echo "updating config." - echo "[config]" >> ${servercfgdir}/ts3db_mariadb.ini - echo "host='${mariahostname}'" >> ${servercfgdir}/ts3db_mariadb.ini - echo "port='${mariaport}'" >> ${servercfgdir}/ts3db_mariadb.ini - echo "username='${mariausername}'" >> ${servercfgdir}/ts3db_mariadb.ini - echo "password='${mariapassword}'" >> ${servercfgdir}/ts3db_mariadb.ini - echo "database='${mariadbname}'" >> ${servercfgdir}/ts3db_mariadb.ini - echo "socket=" >> ${servercfgdir}/ts3db_mariadb.ini + echo "[config]" + echo "host='${mariahostname}'" + echo "port='${mariaport}'" + echo "username='${mariausername}'" + echo "password='${mariapassword}'" + echo "database='${mariadbname}'" + echo "socket=" + } >> "${servercfgdir}/ts3db_mariadb.ini" sed -i "s/dbplugin=ts3db_sqlite3/dbplugin=ts3db_mariadb/g" "${servercfgfullpath}" sed -i "s/dbpluginparameter=/dbpluginparameter=ts3db_mariadb.ini/g" "${servercfgfullpath}" sed -i "s/dbsqlcreatepath=create_sqlite\//dbsqlcreatepath=create_mariadb\//g" "${servercfgfullpath}" From abf3cd12ca957d4ecf6cb0e924a407682abdff16 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 17 Mar 2018 00:42:13 +0000 Subject: [PATCH 2/8] SC2164 --- lgsm/functions/install_ts3db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/install_ts3db.sh b/lgsm/functions/install_ts3db.sh index fc200fa79..b5ec4b3a9 100644 --- a/lgsm/functions/install_ts3db.sh +++ b/lgsm/functions/install_ts3db.sh @@ -71,7 +71,7 @@ echo "=================================" sleep 1 echo "IMPORANT! Save these details for later." sleep 1 -cd "${executabledir}" +cd "${executabledir}" || exit ./ts3server_startscript.sh start inifile=ts3-server.ini sleep 5 ./ts3server_startscript.sh stop From e384b6c77a9c0ed8558432f36e6ad84de3126d4c Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 17 Mar 2018 00:43:26 +0000 Subject: [PATCH 3/8] SC2086 --- lgsm/functions/install_ts3db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/install_ts3db.sh b/lgsm/functions/install_ts3db.sh index b5ec4b3a9..7cfc3205f 100644 --- a/lgsm/functions/install_ts3db.sh +++ b/lgsm/functions/install_ts3db.sh @@ -14,7 +14,7 @@ fn_install_ts3db_mariadb(){ echo "checking if libmariadb2 is installed" echo "=================================" sleep 1 - ldd ${serverfiles}/libts3db_mariadb.so | grep "libmariadb.so.2 => not found" + ldd "${serverfiles}/libts3db_mariadb.so" | grep "libmariadb.so.2 => not found" if [ $? -eq 0 ]; then echo "libmariadb2 not installed. Please install it first." echo "exiting..." From f09769bd21de143591669ba1ef23ad4b39e2874b Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 17 Mar 2018 00:46:59 +0000 Subject: [PATCH 4/8] SC2062 --- lgsm/functions/command_stop.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh index 46c1d55ed..44bf94359 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/functions/command_stop.sh @@ -219,7 +219,7 @@ fn_stop_ark(){ if [ "${#queryport}" -gt 0 ] ; then for (( pidcheck=0 ; pidcheck < ${maxpiditer} ; pidcheck++ )) ; do pid=$(netstat -nap 2>/dev/null | grep ^udp[[:space:]] |\ - grep :${queryport}[[:space:]] | rev | awk '{print $1}' |\ + grep ":${queryport}[[:space:]]" | rev | awk '{print $1}' |\ rev | cut -d\/ -f1) # # check for a valid pid From b6acd560637ed2f36f4d54f8dc16ea2dcf187517 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 17 Mar 2018 00:47:42 +0000 Subject: [PATCH 5/8] SC2046 --- lgsm/functions/command_stop.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh index 44bf94359..4740f2f92 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/functions/command_stop.sh @@ -226,7 +226,7 @@ fn_stop_ark(){ pid=${pid//[!0-9]/} let pid+=0 # turns an empty string into a valid number, '0', # and a valid numeric pid remains unchanged. - if [ "${pid}" -gt 1 ]&&[ "${pid}" -le $(cat "/proc/sys/kernel/pid_max") ]; then + if [ "${pid}" -gt 1 ]&&[ "${pid}" -le "$(cat "/proc/sys/kernel/pid_max")" ]; then fn_print_dots "Process still bound. Awaiting graceful exit: ${pidcheck}" sleep 1 else From 6438fff13a71973d67addcc53d55d2cc716af0e9 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 17 Mar 2018 00:49:53 +0000 Subject: [PATCH 6/8] SC2143 --- lgsm/functions/install_config.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index 00fdd5431..190afbcd3 100644 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -61,8 +61,7 @@ fn_set_config_vars(){ echo "changing hostname." fn_script_log_info "changing hostname." sleep 1 - - if [ "$(grep SERVERNAME=SERVERNAME \"${lgsmdir}/config-default/config-game/${config}\" 2>/dev/null)" ]; then + if grep -q "SERVERNAME=SERVERNAME" "${lgsmdir}/config-default/config-game/${config}" 2>/dev/null; then sed -i "s/SERVERNAME=SERVERNAME/SERVERNAME=${servername}/g" "${servercfgfullpath}" else sed -i "s/SERVERNAME/${servername}/g" "${servercfgfullpath}" From dd902e6431cc82280b4765523fac4b55488e2838 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 17 Mar 2018 00:51:56 +0000 Subject: [PATCH 7/8] SC2086 --- lgsm/functions/check_glibc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/check_glibc.sh b/lgsm/functions/check_glibc.sh index 2690eb7c5..3a99b009b 100644 --- a/lgsm/functions/check_glibc.sh +++ b/lgsm/functions/check_glibc.sh @@ -17,7 +17,7 @@ elif [ "${glibcrequired}" == "UNKNOWN" ]; then fn_print_error_nl "Glibc fix: ${red}${glibcrequired}${default}" echo -e " * glibc required: ${red}${glibcrequired}${default}" echo -e " * glibc installed: ${glibcversion}" -elif [ "$(printf '%s\n'${glibcrequired}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibcrequired}" ]; then +elif [ "$(printf "%s\n'${glibcrequired}'\n" "${glibcversion}" | sort -V | head -n 1)" != "${glibcrequired}" ]; then if [ "${glibcfix}" == "yes" ]; then if [ "${function_selfname}" != "command_install.sh" ]; then fn_print_dots "Glibc fix" From a576e0248a6d3e33bc4917b6a8097b84572748b7 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 17 Mar 2018 00:52:10 +0000 Subject: [PATCH 8/8] SC2164 --- lgsm/functions/update_steamcmd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/update_steamcmd.sh b/lgsm/functions/update_steamcmd.sh index fc9aa8cd4..1b0663df0 100644 --- a/lgsm/functions/update_steamcmd.sh +++ b/lgsm/functions/update_steamcmd.sh @@ -165,7 +165,7 @@ fn_update_steamcmd_check(){ fi # Gets availablebuild info - cd "${steamcmddir}" + cd "${steamcmddir}" || exit availablebuild=$(./steamcmd.sh +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +app_info_print "${appid}" +quit | sed -n '/branch/,$p' | grep -m 1 buildid | tr -cd '[:digit:]') if [ -z "${availablebuild}" ]; then fn_print_fail "Checking for update: SteamCMD"