diff --git a/7DaysToDie/sdtdserver b/7DaysToDie/sdtdserver index 8e04aea42..3c07f7cdb 100644 --- a/7DaysToDie/sdtdserver +++ b/7DaysToDie/sdtdserver @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/Arma3/arma3server b/Arma3/arma3server index cf720bb0e..637910069 100644 --- a/Arma3/arma3server +++ b/Arma3/arma3server @@ -23,7 +23,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/BlackMesa/bmdmserver b/BlackMesa/bmdmserver index 48ae9673e..6a3a4cbce 100644 --- a/BlackMesa/bmdmserver +++ b/BlackMesa/bmdmserver @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/BladeSymphony/bsserver b/BladeSymphony/bsserver index 4dc07246f..d2abd9b5c 100644 --- a/BladeSymphony/bsserver +++ b/BladeSymphony/bsserver @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/BrainBread2/bb2server b/BrainBread2/bb2server index 2aa450534..7211aaf6b 100644 --- a/BrainBread2/bb2server +++ b/BrainBread2/bb2server @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/CodenameCURE/ccserver b/CodenameCURE/ccserver index ab8ab009f..7bf5dce99 100644 --- a/CodenameCURE/ccserver +++ b/CodenameCURE/ccserver @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/CounterStrike/csserver b/CounterStrike/csserver index 04cc4aa6c..9fd3660e9 100644 --- a/CounterStrike/csserver +++ b/CounterStrike/csserver @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/CounterStrikeConditionZero/csczserver b/CounterStrikeConditionZero/csczserver index e0cbc3d21..ae3d8cb86 100644 --- a/CounterStrikeConditionZero/csczserver +++ b/CounterStrikeConditionZero/csczserver @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/CounterStrikeGlobalOffensive/csgoserver b/CounterStrikeGlobalOffensive/csgoserver index f2662d5c6..940115c9c 100755 --- a/CounterStrikeGlobalOffensive/csgoserver +++ b/CounterStrikeGlobalOffensive/csgoserver @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/CounterStrikeSource/cssserver b/CounterStrikeSource/cssserver index 814e1cf71..cc66b0f6c 100644 --- a/CounterStrikeSource/cssserver +++ b/CounterStrikeSource/cssserver @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/DayOfDefeat/dodserver b/DayOfDefeat/dodserver index 6612fb477..747e1f20c 100644 --- a/DayOfDefeat/dodserver +++ b/DayOfDefeat/dodserver @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/DayOfDefeatSource/dodsserver b/DayOfDefeatSource/dodsserver index d4d2d05f0..f62502150 100644 --- a/DayOfDefeatSource/dodsserver +++ b/DayOfDefeatSource/dodsserver @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/DeathmatchClassic/dmcserver b/DeathmatchClassic/dmcserver index ecee9ab39..64ccb7c8b 100644 --- a/DeathmatchClassic/dmcserver +++ b/DeathmatchClassic/dmcserver @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/DontStarveTogether/dstserver b/DontStarveTogether/dstserver index c118ee466..b82667778 100644 --- a/DontStarveTogether/dstserver +++ b/DontStarveTogether/dstserver @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/DoubleActionBoogaloo/dabserver b/DoubleActionBoogaloo/dabserver index 05f624dbe..f1b20c2ec 100644 --- a/DoubleActionBoogaloo/dabserver +++ b/DoubleActionBoogaloo/dabserver @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/FistfulOfFrags/fofserver b/FistfulOfFrags/fofserver index 668f65810..c352d9484 100644 --- a/FistfulOfFrags/fofserver +++ b/FistfulOfFrags/fofserver @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/GarrysMod/gmodserver b/GarrysMod/gmodserver index ea4c85292..79b8c8378 100644 --- a/GarrysMod/gmodserver +++ b/GarrysMod/gmodserver @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/GoldenEyeSource/gesserver b/GoldenEyeSource/gesserver index 778c69a43..e752ec529 100644 --- a/GoldenEyeSource/gesserver +++ b/GoldenEyeSource/gesserver @@ -23,7 +23,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/HalfLife2Deathmatch/hl2dmserver b/HalfLife2Deathmatch/hl2dmserver index b3cd29604..f287be9bc 100644 --- a/HalfLife2Deathmatch/hl2dmserver +++ b/HalfLife2Deathmatch/hl2dmserver @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/HalfLifeDeathmatch/hldmserver b/HalfLifeDeathmatch/hldmserver index ab75a9efe..8a5572cdb 100644 --- a/HalfLifeDeathmatch/hldmserver +++ b/HalfLifeDeathmatch/hldmserver @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/HalfLifeDeathmatchSource/hldmsserver b/HalfLifeDeathmatchSource/hldmsserver index 40dc54266..b65090e8a 100644 --- a/HalfLifeDeathmatchSource/hldmsserver +++ b/HalfLifeDeathmatchSource/hldmsserver @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/Hurtworld/hwserver b/Hurtworld/hwserver index 4c93d73e2..3af56de28 100644 --- a/Hurtworld/hwserver +++ b/Hurtworld/hwserver @@ -23,7 +23,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/Insurgency/insserver b/Insurgency/insserver index 7f337536e..1a0a07862 100644 --- a/Insurgency/insserver +++ b/Insurgency/insserver @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login @@ -71,7 +71,7 @@ functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/insurgency" executabledir="${filesdir}" -executable="./srcds_linux" +executable="./srcds_run" servercfg="${servicename}.cfg" servercfgdir="${systemdir}/cfg" servercfgfullpath="${servercfgdir}/${servercfg}" diff --git a/JustCause2/jc2server b/JustCause2/jc2server index 5db3b0a10..ddc0eafd2 100644 --- a/JustCause2/jc2server +++ b/JustCause2/jc2server @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/KillingFloor/kfserver b/KillingFloor/kfserver index 5380e71d8..385a46649 100644 --- a/KillingFloor/kfserver +++ b/KillingFloor/kfserver @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/Left4Dead/l4dserver b/Left4Dead/l4dserver index d70fce9f3..bbf73359e 100644 --- a/Left4Dead/l4dserver +++ b/Left4Dead/l4dserver @@ -23,7 +23,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/Left4Dead2/l4d2server b/Left4Dead2/l4d2server index 12a29437f..bae9c975a 100644 --- a/Left4Dead2/l4d2server +++ b/Left4Dead2/l4d2server @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Pushover diff --git a/Mumble/mumbleserver b/Mumble/mumbleserver index 11a531f6a..ed972bedb 100644 --- a/Mumble/mumbleserver +++ b/Mumble/mumbleserver @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Server Details diff --git a/NS2Combat/ns2cserver b/NS2Combat/ns2cserver index 4b4628724..e23c30264 100644 --- a/NS2Combat/ns2cserver +++ b/NS2Combat/ns2cserver @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/NaturalSelection2/ns2server b/NaturalSelection2/ns2server index a89192c53..919468d24 100644 --- a/NaturalSelection2/ns2server +++ b/NaturalSelection2/ns2server @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/NoMoreRoomInHell/nmrihserver b/NoMoreRoomInHell/nmrihserver index 878bf985e..3c6f7630d 100644 --- a/NoMoreRoomInHell/nmrihserver +++ b/NoMoreRoomInHell/nmrihserver @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/OpposingForce/opforserver b/OpposingForce/opforserver index 9be4d6573..e670662b3 100644 --- a/OpposingForce/opforserver +++ b/OpposingForce/opforserver @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/PiratesVikingandKnightsII/pvkiiserver b/PiratesVikingandKnightsII/pvkiiserver index 85ac0c1ff..90c5172cf 100644 --- a/PiratesVikingandKnightsII/pvkiiserver +++ b/PiratesVikingandKnightsII/pvkiiserver @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/ProjectZomboid/pzserver b/ProjectZomboid/pzserver index 9bf5284cd..043f46015 100644 --- a/ProjectZomboid/pzserver +++ b/ProjectZomboid/pzserver @@ -23,7 +23,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/QuakeLive/qlserver b/QuakeLive/qlserver index f47aee840..77b09a5b7 100755 --- a/QuakeLive/qlserver +++ b/QuakeLive/qlserver @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/RedOrchestra/roserver b/RedOrchestra/roserver index cccaa7aeb..3073a9f14 100644 --- a/RedOrchestra/roserver +++ b/RedOrchestra/roserver @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/Ricochet/ricochetserver b/Ricochet/ricochetserver index e59d5c777..cfb8746eb 100644 --- a/Ricochet/ricochetserver +++ b/Ricochet/ricochetserver @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/Rust/rustserver b/Rust/rustserver index 23666b39c..7c200bdae 100644 --- a/Rust/rustserver +++ b/Rust/rustserver @@ -23,7 +23,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login (not required) diff --git a/SeriousSam3BFE/ss3sserver b/SeriousSam3BFE/ss3sserver index cad500dc1..f9fab4cd8 100644 --- a/SeriousSam3BFE/ss3sserver +++ b/SeriousSam3BFE/ss3sserver @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/StarBound/sbserver b/StarBound/sbserver index 3837c6213..232063344 100644 --- a/StarBound/sbserver +++ b/StarBound/sbserver @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/SvenCoop/svencoopserver b/SvenCoop/svencoopserver index f58719276..099631bf0 100644 --- a/SvenCoop/svencoopserver +++ b/SvenCoop/svencoopserver @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/TeamFortress2/tf2server b/TeamFortress2/tf2server index 3a13f4a37..69533c635 100644 --- a/TeamFortress2/tf2server +++ b/TeamFortress2/tf2server @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/TeamFortressClassic/tfcserver b/TeamFortressClassic/tfcserver index fa05c0a1d..e4fc40e99 100644 --- a/TeamFortressClassic/tfcserver +++ b/TeamFortressClassic/tfcserver @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/TeamSpeak3/ts3server b/TeamSpeak3/ts3server index 7cf1c88ca..12eefa48d 100644 --- a/TeamSpeak3/ts3server +++ b/TeamSpeak3/ts3server @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Start Variables diff --git a/Teeworlds/twserver b/Teeworlds/twserver index 1cfc86b53..67adbe4c6 100644 --- a/Teeworlds/twserver +++ b/Teeworlds/twserver @@ -23,7 +23,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/Terraria/terrariaserver b/Terraria/terrariaserver index 51bc754b0..8019fb888 100644 --- a/Terraria/terrariaserver +++ b/Terraria/terrariaserver @@ -23,7 +23,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Steam login diff --git a/UnrealTournament2004/ut2k4server b/UnrealTournament2004/ut2k4server index fcdabc3c6..5b59c24b2 100644 --- a/UnrealTournament2004/ut2k4server +++ b/UnrealTournament2004/ut2k4server @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Start Variables diff --git a/UnrealTournament99/ut99server b/UnrealTournament99/ut99server index 00055db8e..707f4dc2e 100644 --- a/UnrealTournament99/ut99server +++ b/UnrealTournament99/ut99server @@ -22,7 +22,7 @@ email="email@example.com" # Pushbullet # https://www.pushbullet.com/#settings -pushbulletalert"off" +pushbulletalert="off" pushbullettoken="accesstoken" # Start Variables diff --git a/functions/core_functions.sh b/functions/core_functions.sh index 821cd4563..0fca7da03 100644 --- a/functions/core_functions.sh +++ b/functions/core_functions.sh @@ -14,6 +14,15 @@ if [ -z "${lgsmdir}" ]; then fi fn_fetch_core_dl(){ +if [ -z "${githubuser}" ]; then + githubuser="dgibbs64" +fi +if [ -z "${githubrepo}" ]; then + githubrepo="linuxgsm" +fi +if [ -z "${githubbranch}" ]; then + githubbranch="master" +fi github_file_url_dir="lgsm/functions" github_file_url_name="${functionfile}" filedir="${functionsdir}" @@ -60,4 +69,4 @@ functionfile="${FUNCNAME}" fn_fetch_core_dl } -core_functions.sh \ No newline at end of file +core_functions.sh diff --git a/functions/update_functions.sh b/functions/update_functions.sh new file mode 100644 index 000000000..5513d5d20 --- /dev/null +++ b/functions/update_functions.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# LGSM fn_update_functions function +# Author: Daniel Gibbs +# Website: https://gameservermanagers.com +lgsm_version="210516" + +# Description: REDIRECT FUNCTION to new command_update_functions.sh + +command_update_functions.sh(){ +functionfile="${FUNCNAME}" +fn_runfunction +} + +command_update_functions.sh + diff --git a/lgsm/functions/alert.sh b/lgsm/functions/alert.sh index 60833fd62..640b04b36 100644 --- a/lgsm/functions/alert.sh +++ b/lgsm/functions/alert.sh @@ -8,7 +8,7 @@ lgsm_version="210516" fn_alert_test(){ fn_scriptlog "Sending test alert" - alertsubject="LGSM - Alert Check - ${servername}" + alertsubject="LGSM - Test Alert - ${servername}" alertbody="LGSM test alert, how you read?" } @@ -21,13 +21,13 @@ fn_alert_restart(){ fn_alert_restart_query(){ fn_scriptlog "Sending restart alert: ${gsquerycmd}" alertsubject="LGSM - Restarted - ${servername}" - alertbody="Failed to Query: ${gsquerycmd}" + alertbody="gsquery.py failed to query: ${gsquerycmd}" } fn_alert_update(){ fn_scriptlog "Sending update alert" alertsubject="LGSM - Updated - ${servername}" - alertbody="${servicename} Recieved update" + alertbody="${servicename} recieved update" } if [ "${alert}" == "restart" ]; then @@ -43,7 +43,7 @@ fi if [ "${emailnotification}" == "on" ]||[ "${emailalert}" == "on" ]&&[ -n "${email}" ]; then alert_email.sh elif [ "${emailnotification}" != "on" ]||[ "${emailalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then - fn_print_fail_nl "Alerts not enabled" + fn_print_info_nl "Email alerts not enabled" fn_scriptlog "Email alerts not enabled" elif [ -z "${email}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then fn_print_fail_nl "Email no set" @@ -53,7 +53,7 @@ fi if [ "${pushbulletalert}" == "on" ]&&[ -n "${pushbullettoken}" ]; then alert_pushbullet.sh elif [ "${pushbulletalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then - fn_print_fail_nl "Pushbullet alerts not enabled" + fn_print_info_nl "Pushbullet alerts not enabled" fn_scriptlog "Pushbullet alerts not enabled" elif [ -z "${pushbullettoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then fn_print_fail_nl "Pushbullet token not set" diff --git a/lgsm/functions/command_monitor.sh b/lgsm/functions/command_monitor.sh index 58b6c90d1..cab5daea9 100644 --- a/lgsm/functions/command_monitor.sh +++ b/lgsm/functions/command_monitor.sh @@ -66,7 +66,7 @@ fn_monitor_tmux(){ local allowed_engines_array=( avalanche goldsource realvirtuality source spark unity3d unreal unreal2 ) for allowed_engine in "${allowed_engines_array[@]}" do - if [ "${allowed_engine}" == "${function_selfname}" ]; then + if [ "${allowed_engine}" == "${engine}" ]; then monitor_gsquery.sh fi done diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh index d7b9ddd33..a5d18c7f6 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/functions/command_stop.sh @@ -17,8 +17,8 @@ fn_stop_graceful_source(){ tmux send -t "${servicename}" quit ENTER > /dev/null 2>&1 # waits up to 30 seconds giving the server time to shutdown gracefuly for seconds in {1..30}; do - pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -Ec "^${servicename}:") - if [ "${pid}" == "0" ]; then + check_status.sh + if [ "${status}" == "0" ]; then fn_print_ok "Graceful: rcon quit: ${seconds}: " fn_print_ok_eol_nl fn_scriptlog "Graceful: rcon quit: OK: ${seconds} seconds" @@ -27,7 +27,8 @@ fn_stop_graceful_source(){ sleep 1 fn_print_dots "Graceful: rcon quit: ${seconds}" done - if [ "${pid}" != "0" ]; then + check_status.sh + if [ "${status}" != "0" ]; then fn_print_fail "Graceful: rcon quit: " fn_print_fail_eol_nl fn_scriptlog "Graceful: rcon quit: FAIL" @@ -202,11 +203,17 @@ fn_stop_teamspeak3(){ fn_scriptlog "${servername}" sleep 1 ${filesdir}/ts3server_startscript.sh stop > /dev/null 2>&1 - # Remove lock file - rm -f "${rootdir}/${lockselfname}" - fn_print_ok_nl "${servername}" - fn_scriptlog "Stopped ${servername}" - } + check_status.sh + if [ "${status}" == "0" ]; then + # Remove lock file + rm -f "${rootdir}/${lockselfname}" + fn_print_ok_nl "${servername}" + fn_scriptlog "Stopped ${servername}" + else + fn_print_fail_nl "Unable to stop${servername}" + fn_scriptlog "Unable to stop${servername}" + fi +} fn_stop_tmux(){ fn_print_dots "${servername}" @@ -215,8 +222,8 @@ fn_stop_tmux(){ # Kill tmux session tmux kill-session -t "${servicename}" > /dev/null 2>&1 sleep 0.5 - pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -Ec "^${servicename}:") - if [ "${pid}" == "0" ]; then + check_status.sh + if [ "${status}" == "0" ]; then # Remove lock file rm -f "${rootdir}/${lockselfname}" # ARK doesn't clean up immediately after tmux is killed. @@ -244,8 +251,8 @@ fn_stop_pre_check(){ fn_stop_teamspeak3 fi else - pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -Ec "^${servicename}:") - if [ "${pid}" == "0" ]; then + check_status.sh + if [ "${status}" == "0" ]; then fn_print_ok_nl "${servername} is already stopped" fn_scriptlog "${servername} is already stopped" else diff --git a/lgsm/functions/install_gsquery.sh b/lgsm/functions/install_gsquery.sh index 2edb28e94..86025c0a0 100644 --- a/lgsm/functions/install_gsquery.sh +++ b/lgsm/functions/install_gsquery.sh @@ -5,7 +5,7 @@ lgsm_version="210516" fn_dlgsquery(){ - cd "${rootdir}" + cd "${functionsdir}" echo -e "downloading gsquery.py...\c" wget -N /dev/null "https://gameservermanagers.com/dl/gsquery.py" 2>&1 | grep -F "HTTP" | grep -v "Moved Permanently" | cut -c45- | uniq chmod +x gsquery.py diff --git a/lgsm/functions/logs.sh b/lgsm/functions/logs.sh index 4ce5774f1..dcb87697f 100644 --- a/lgsm/functions/logs.sh +++ b/lgsm/functions/logs.sh @@ -17,9 +17,9 @@ if [ -n "${consolelog}" ]; then fi # For games not displaying a console, and having logs into their game folder -if [ -n "${gamelogfile}" ]; then +if [ "${function_selfname}" == "command_start.sh" ] && [ -n "${gamelogfile}" ]; then if [ -n "$(find "${systemdir}" -name "gamelog*.log")" ]; then - fn_printinfo "Moving game logs to ${gamelogdir}" + fn_print_info "Moving game logs to ${gamelogdir}" fn_scriptlog "Moving game logs to ${gamelogdir}" echo -en "\n" sleep 1 diff --git a/lgsm/functions/monitor_gsquery.sh b/lgsm/functions/monitor_gsquery.sh index 747b6dd45..b93b15cf0 100644 --- a/lgsm/functions/monitor_gsquery.sh +++ b/lgsm/functions/monitor_gsquery.sh @@ -9,7 +9,7 @@ lgsm_version="210516" local modulename="Monitor" -# Forces legecy servers to use gsquery as vat gsquery is not present in legecy +# Forces legecy servers to use gsquery if [ -z "${gsquery}" ]; then gsquery="yes" fi @@ -29,7 +29,7 @@ if [ "${gsquery}" == "yes" ]; then port=$((port + 1)) fi - if [ -z "${queryport}" ]; then + if [ -n "${queryport}" ]; then port="${queryport}" fi @@ -46,14 +46,14 @@ if [ "${gsquery}" == "yes" ]; then fn_print_querying_eol fn_scriptlog "Querying port: ${ip}:${port} : ${queryattempt} : QUERYING" - gsquerycmd=$("${functionsdir}"/gsquery.py -a "${ip}" -p 1 -e "${engine}" 2>&1) + gsquerycmd=$("${functionsdir}"/gsquery.py -a "${ip}" -p "${port}" -e "${engine}" 2>&1) exitcode=$? sleep 1 if [ "${exitcode}" == "0" ]; then # Server OK fn_print_ok "Querying port: ${ip}:${port} : ${queryattempt} : " - fn_print_ok_eol + fn_print_ok_eol_nl fn_scriptlog "Querying port: ${ip}:${port} : ${queryattempt} : OK" sleep 1 exit