Browse Source

Merge remote-tracking branch 'refs/remotes/origin/master' into development

pull/956/head
Daniel Gibbs 9 years ago
parent
commit
b58de8ea94
  1. 9
      NoMoreRoomInHell/nmrihserver
  2. 22
      README.md
  3. 141
      StarBound/cfg/sbboot.config
  4. 49
      Starbound/cfg/lgsm-default.config
  5. 11
      Starbound/sbserver
  6. 10
      lgsm/functions/check.sh
  7. 21
      lgsm/functions/check_config.sh
  8. 2
      lgsm/functions/check_deps.sh
  9. 4
      lgsm/functions/check_permissions.sh
  10. 28
      lgsm/functions/check_system_requirements.sh
  11. 10
      lgsm/functions/command_details.sh
  12. 6
      lgsm/functions/command_validate.sh
  13. 5
      lgsm/functions/core_functions.sh
  14. 24
      lgsm/functions/core_messages.sh
  15. 82
      lgsm/functions/info_config.sh
  16. 5
      lgsm/functions/info_distro.sh
  17. 26
      lgsm/functions/info_parms.sh
  18. 6
      lgsm/functions/install_config.sh
  19. 33
      lgsm/functions/install_gsquery.sh
  20. 28
      lgsm/functions/update_ts3.sh

9
NoMoreRoomInHell/nmrihserver

@ -9,7 +9,7 @@ if [ -f ".dev-debug" ]; then
set -x
fi
version="210516"
version="130716"
#### Variables ####
@ -38,9 +38,14 @@ clientport="27005"
ip="0.0.0.0"
updateonstart="off"
# Optional: Game Server Login Token
# GSLT can be used for running a public server.
# More info: https://gameservermanagers.com/gslt
gslt=""
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server
fn_parms(){
parms="-game nmrih -insecure -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}"
parms="-game nmrih -insecure -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers}"
}
#### Advanced Variables ####

22
README.md

@ -43,12 +43,18 @@ If you want to donate to the project you can via PayPal, Flattr or Gratipay. I h
</ul>
<h2>Useful Links</h2>
<ul>
<li><a href="https://gameservermanagers.com">Homepage</li>
<li><a href="https://github.com/dgibbs64/linuxgsm/wiki">Wiki</li>
<li><a href="https://github.com/dgibbs64/linuxgsm">GitHub Code</li>
<li><a href="https://github.com/dgibbs64/linuxgsm/issues">GitHub Issues</li>
<li><a href="http://steamcommunity.com/groups/linuxgsm">Steam Group</li>
<li><a href="https://twitter.com/dangibbsuk">Twitter</li>
<li><a href="https://www.facebook.com/linuxgsm">Facebook</li>
<li><a href="https://plus.google.com/+Gameservermanagers1">Google+</li>
<li><a href="https://gameservermanagers.com">Homepage</a></li>
<li><a href="https://github.com/dgibbs64/linuxgsm/wiki">Wiki</a></li>
<li><a href="https://github.com/dgibbs64/linuxgsm">GitHub Code</a></li>
<li><a href="https://github.com/dgibbs64/linuxgsm/issues">GitHub Issues</a></li>
<li><a href="https://waffle.io/dgibbs64/linuxgsm">Waffle (Github Dashboard)</a></li>
<li><a href="http://alternativeto.net/software/linux-game-server-managers/">alternativeTo.net</a></li>
</ul>
<h2>Social</h2>
<ul>
<li><a href="http://steamcommunity.com/groups/linuxgsm">Steam Group</a></li>
<li><a href="https://discord.gg/0i9cmXVacvXicNl7">Discord</a></li>
<li><a href="https://twitter.com/dangibbsuk">Twitter</a></li>
<li><a href="https://www.facebook.com/linuxgsm">Facebook</a></li>
<li><a href="https://plus.google.com/+Gameservermanagers1">Google+</a></li>
<ul>

141
StarBound/cfg/sbboot.config

@ -1,141 +0,0 @@
{
"handleFatalSignals" : true,
"handleInterruptSignal" : true,
"rootMaintenanceSleep" : 5000,
"logFileBackups" : 5,
"assetSources" : [
"../assets/packed.pak",
"../assets/user"
],
"modSource" : "../giraffe_storage/mods/",
"storageDirectory" : "../giraffe_storage/",
"defaultConfiguration" : {
"gameServerPort" : 21025,
"gameServerBind" : "*",
"serverUsers" : {},
"allowAnonymousConnections" : true,
"bannedUuids" : [],
"bannedIPs" : [],
"serverName" : "A Starbound Server",
"maxPlayers" : 8,
"upnpPortForwarding" : true,
"checkAssetsDigest" : false,
"allowAdminCommands" : true,
"allowAdminCommandsFromAnyone" : false,
"anonymousConnectionsAreAdmin" : false,
"runQueryServer" : false,
"queryServerPort" : 21025,
"queryServerBind" : "*",
"runRconServer" : false,
"rconServerPort" : 21026,
"rconServerBind" : "*",
"rconServerPassword" : "",
"rconServerTimeout" : 1000,
"windowTitle" : "Starbound - Beta",
"vsync" : true,
"renderSleep" : true,
"maxFrameSkip" : 10,
"sampleRate" : 44100,
"audioChannels" : 2,
"audioChannelSeparation" : [-25, 25],
"clearUniverseFiles" : false,
"clearPlayerFiles" : false,
"playerBackupFileCount" : 3,
"sfxVol" : 100,
"musicVol" : 100,
"windowedResolution" : [1000, 600],
"maximizedResolution" : [1000, 600],
"fullscreenResolution" : [1920, 1080],
"fullscreen" : false,
"maximized" : true,
"zoomLevel" : 3.0,
"speechBubbles" : true,
"crafting.filterHaveMaterials" : false,
"title.connectionString" : "",
"bindings" : {
"PlayerUp" : [ { "type" : "key", "value" : "W", "mods" : [] } ],
"PlayerDown" : [ { "type" : "key", "value" : "S", "mods" : [] } ],
"PlayerLeft" : [ { "type" : "key", "value" : "A", "mods" : [] } ],
"PlayerRight" : [ { "type" : "key", "value" : "D", "mods" : [] } ],
"PlayerJump" : [ { "type" : "key", "value" : "Space", "mods" : [] } ],
"PlayerDropItem" : [ { "type" : "key", "value" : "Q", "mods" : [] } ],
"PlayerInteract" : [ { "type" : "key", "value" : "E", "mods" : [] } ],
"PlayerShifting" : [ { "type" : "key", "value" : "RShift", "mods" : [] }, { "type" : "key", "value" : "LShift", "mods" : [] } ],
"PlayerTechAction1" : [ { "type" : "key", "value" : "F", "mods" : [] } ],
"PlayerTechAction2" : [ { "type" : "key", "value" : "G", "mods" : [] } ],
"PlayerTechAction3" : [ { "type" : "key", "value" : "H", "mods" : [] } ],
"EmoteBlabbering" : [ { "type" : "key", "value" : "Right", "mods" : ["LCt rl", "LShift"] } ],
"EmoteShouting" : [ { "type" : "key", "value" : "Up", "mods" : ["LCtrl", "LAlt"] } ],
"EmoteHappy" : [ { "type" : "key", "value" : "Up", "mods" : [] } ],
"EmoteSad" : [ { "type" : "key", "value" : "Down", "mods" : [] } ],
"EmoteNeutral" : [ { "type" : "key", "value" : "Left", "mods" : [] } ],
"EmoteLaugh" : [ { "type" : "key", "value" : "Left", "mods" : [ "LCtrl" ] } ],
"EmoteAnnoyed" : [ { "type" : "key", "value" : "Right", "mods" : [] } ],
"EmoteOh" : [ { "type" : "key", "value" : "Right", "mods" : [ "LCtrl" ] } ],
"EmoteOooh" : [ { "type" : "key", "value" : "Down", "mods" : [ "LCtrl" ] } ],
"EmoteBlink" : [ { "type" : "key", "value" : "Up", "mods" : [ "LCtrl" ] } ],
"EmoteWink" : [ { "type" : "key", "value" : "Up", "mods" : ["LCtrl", "LSh ift"] } ],
"EmoteEat" : [ { "type" : "key", "value" : "Down", "mods" : ["LCtrl", "LS hift"] } ],
"EmoteSleep" : [ { "type" : "key", "value" : "Left", "mods" : ["LCtrl", " LShift"] } ],
"ShowLabels" : [ { "type" : "key", "value" : "RAlt", "mods" : [] }, { "ty pe" : "key", "value" : "LAlt", "mods" : [] } ],
"CameraShift" : [ { "type" : "key", "value" : "RCtrl", "mods" : [] }, { " type" : "key", "value" : "LCtrl", "mods" : [] } ],
"CockpitUp" : [ { "type" : "key", "value" : "W", "mods" : [] }, { "type" : "key", "value" : "Up", "mods" : [] } ],
"CockpitDown" : [ { "type" : "key", "value" : "S", "mods" : [] }, { "type " : "key", "value" : "Down", "mods" : [] } ],
"CockpitLeft" : [ { "type" : "key", "value" : "Left", "mods" : [] }, { "t ype" : "key", "value" : "A", "mods" : [] } ],
"CockpitRight" : [ { "type" : "key", "value" : "Right", "mods" : [] }, { "type" : "key", "value" : "D", "mods" : [] } ],
"TitleBack" : [ { "type" : "key", "value" : "Esc", "mods" : [] } ],
"CinematicSkip" : [ { "type" : "key", "value" : "Esc", "mods" : [] } ],
"CinematicNext" : [ { "type" : "key", "value" : "Right", "mods" : [] }, { "type" : "key", "value" : "Return", "mods" : [] } ],
"GuiClose" : [ { "type" : "key", "value" : "Esc", "mods" : [] } ],
"GuiShifting" : [ { "type" : "key", "value" : "RShift", "mods" : [] }, { "type" : "key", "value" : "LShift", "mods" : [] } ],
"KeybindingCancel" : [ { "type" : "key", "value" : "Esc", "mods" : [] } ] ,
"KeybindingClear" : [ { "type" : "key", "value" : "Del", "mods" : [] }, { "type" : "key", "value" : "Backspace", "mods" : [] } ],
"ChatPageUp" : [ { "type" : "key", "value" : "PageUp", "mods" : [] } ],
"ChatPageDown" : [ { "type" : "key", "value" : "PageDown", "mods" : [] } ],
"ChatPreviousLine" : [ { "type" : "key", "value" : "Up", "mods" : [] } ],
"ChatNextLine" : [ { "type" : "key", "value" : "Down", "mods" : [] } ],
"ChatSendLine" : [ { "type" : "key", "value" : "Return", "mods" : [] } ],
"ChatBegin" : [ { "type" : "key", "value" : "Return", "mods" : [] } ],
"ChatBeginCommand" : [ { "type" : "key", "value" : "/", "mods" : [] } ],
"ChatStop" : [ { "type" : "key", "value" : "Esc", "mods" : [] } ],
"InterfaceShowHelp" : [ { "type" : "key", "value" : "F1", "mods" : [] } ] ,
"InterfaceHideHud" : [ { "type" : "key", "value" : "Z", "mods" : [ "LAlt" ] } ],
"InterfaceSwapHands" : [ { "type" : "key", "value" : "Z", "mods" : [] } ] ,
"InterfaceDeselectHands" : [ { "type" : "key", "value" : "X", "mods" : [] } ],
"InterfaceBar1" : [ { "type" : "key", "value" : "1", "mods" : [] } ],
"InterfaceBar2" : [ { "type" : "key", "value" : "2", "mods" : [] } ],
"InterfaceBar3" : [ { "type" : "key", "value" : "3", "mods" : [] } ],
"InterfaceBar4" : [ { "type" : "key", "value" : "4", "mods" : [] } ],
"InterfaceBar5" : [ { "type" : "key", "value" : "5", "mods" : [] } ],
"InterfaceBar6" : [ { "type" : "key", "value" : "6", "mods" : [] } ],
"InterfaceBar7" : [ { "type" : "key", "value" : "7", "mods" : [] } ],
"InterfaceBar8" : [ { "type" : "key", "value" : "8", "mods" : [] } ],
"InterfaceBar9" : [ { "type" : "key", "value" : "9", "mods" : [] } ],
"InterfaceBar10" : [ { "type" : "key", "value" : "0", "mods" : [] } ],
"EssentialBar1" : [ { "type" : "key", "value" : "R", "mods" : [] } ],
"EssentialBar2" : [ { "type" : "key", "value" : "T", "mods" : [] } ],
"EssentialBar3" : [ { "type" : "key", "value" : "Y", "mods" : [] } ],
"InterfaceBarNPos" : [ { "type" : "key", "value" : "-", "mods" : [] }, { "type" : "key", "value" : "`", "mods" : [] } ],
"InterfaceRepeatCommand" : [ { "type" : "key", "value" : "P", "mods" : [] } ],
"InterfaceToggleFullscreen" : [ { "type" : "key", "value" : "F11", "mods" : [] } ],
"InterfaceEscapeMenu" : [ { "type" : "key", "value" : "Esc", "mods" : [] } ],
"InterfaceInventory" : [ { "type" : "key", "value" : "I", "mods" : [] } ] ,
"InterfaceCodex" : [ { "type" : "key", "value" : "L", "mods" : [] } ],
"InterfaceQuest" : [ { "type" : "key", "value" : "J", "mods" : [] } ],
"InterfaceCrafting" : [ { "type" : "key", "value" : "C", "mods" : [] } ],
"InterfaceInspectCursor" : [ { "type" : "key", "value" : "N", "mods" : [] } ]
}
}
}

49
Starbound/cfg/lgsm-default.config

@ -0,0 +1,49 @@
{
"allowAdminCommands" : true,
"allowAdminCommandsFromAnyone" : false,
"allowAnonymousConnections" : true,
"allowAssetsMismatch" : true,
"anonymousConnectionsAreAdmin" : false,
"bannedIPs" : [],
"bannedUuids" : [],
"checkAssetsDigest" : false,
"clearPlayerFiles" : false,
"clearUniverseFiles" : false,
"clientIPJoinable" : false,
"clientP2PJoinable" : true,
"configurationVersion" : {
"basic" : 1,
"server" : 4
},
"crafting" : {
"filterHaveMaterials" : false
},
"gameServerBind" : "::",
"gameServerPort" : 21025,
"interactiveHighlight" : true,
"inventory" : {
"pickupToActionBar" : true
},
"maxPlayers" : 8,
"maxTeamSize" : 4,
"playerBackupFileCount" : 3,
"queryServerBind" : "::",
"queryServerPort" : 21025,
"rconServerBind" : "::",
"rconServerPassword" : "<rconpassword>",
"rconServerPort" : 21026,
"rconServerTimeout" : 1000,
"runQueryServer" : false,
"runRconServer" : false,
"safeScripts" : true,
"scriptInstructionLimit" : 10000000,
"scriptInstructionMeasureInterval" : 10000,
"scriptProfilingEnabled" : false,
"scriptRecursionLimit" : 100,
"serverFidelity" : "automatic",
"serverName" : "<hostname>",
"serverOverrideAssetsDigest" : null,
"serverUsers" : {
},
"tutorialMessages" : true
}

11
StarBound/sbserver → Starbound/sbserver

@ -9,7 +9,7 @@ if [ -f ".dev-debug" ]; then
set -x
fi
version="210516"
version="230716"
#### Variables ####
@ -62,16 +62,17 @@ lgsmdir="${rootdir}/lgsm"
functionsdir="${lgsmdir}/functions"
filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}"
executabledir="${filesdir}/linux64"
executabledir="${filesdir}/linux"
executable="./starbound_server"
servercfg="sbboot.config"
servercfgdir="${executabledir}"
servercfg="starbound_server.config"
servercfgdir="${filesdir}/storage"
servercfgfullpath="${servercfgdir}/${servercfg}"
servercfgdefault="${servercfgdir}/lgsm-default.config"
backupdir="${rootdir}/backups"
# Logging
logdays="7"
gamelogdir="${filesdir}/giraffe_storage"
gamelogdir="${filesdir}/storage"
scriptlogdir="${rootdir}/log/script"
consolelogdir="${rootdir}/log/console"
consolelogging="on"

10
lgsm/functions/check.sh

@ -63,7 +63,7 @@ done
local allowed_commands_array=( command_console.sh command_start.sh )
for allowed_command in "${allowed_commands_array[@]}"
do
if [ "${allowed_command}" == "${function_selfname}" ]; then
if [ "${allowed_command}" == "${function_selfname}" ]||[ "${gamename}" != "Teamspeak 3" ]; then
check_tmux.sh
fi
done
@ -83,3 +83,11 @@ do
check_status.sh
fi
done
local allowed_commands_array=( command_install.sh command_start.sh command_debug.sh )
for allowed_command in "${allowed_commands_array[@]}"
do
if [ "${allowed_command}" == "${function_selfname}" ]; then
check_system_requirements.sh
fi
done

21
lgsm/functions/check_config.sh

@ -17,4 +17,23 @@ if [ ! -e "${servercfgfullpath}" ]; then
fn_script_log_warn "${servercfgfullpath}"
sleep 2
fi
fi
fi
if [ "${gamename}" == "Rust" ]; then
if [ -z "${rconpassword}" ]; then
fn_print_dots ""
sleep 0.5
fn_print_fail_nl "RCON password is not set!"
echo " * Not setting an RCON password causes issues with ${gamename}"
fn_script_log_fatal "RCON password is not set"
fn_script_log_fatal "Not setting an RCON password causes issues with ${gamename}"
core_exit.sh
elif [ "${rconpassword}" == "CHANGE_ME" ]; then
fn_print_dots ""
sleep 0.5
fn_print_warn_nl "Default RCON Password detected!"
echo " * Having ${rconpassword} as a password is not very safe."
fn_script_log_warn "Default RCON Password detected"
sleep 2
fi
fi

2
lgsm/functions/check_deps.sh

@ -88,7 +88,7 @@ fn_found_missing_deps(){
fn_print_failure_nl "Unable to install dependencies"
fn_script_log_fail "Unable to install dependencies"
else
fn_print_success_nl "Install dependencies completed"
fn_print_complete_nl "Install dependencies completed"
fn_script_log_pass "Install dependencies completed"
fi
else

4
lgsm/functions/check_permissions.sh

@ -9,14 +9,14 @@ local commandname="CHECK"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
fn_check_ownership(){
if [ $(find "${rootdir}" -not -user $(whoami)|wc -l) -ne "0" ]; then
if [ $(find "${filesdir}" -not -user $(whoami)|wc -l) -ne "0" ]||[ $(find "${rootdir}/${selfname}" -not -user $(whoami)|wc -l) -ne "0" ]; then
fn_print_fail_nl "Permissions issues found"
fn_script_log_fatal "Permissions issues found"
fn_print_infomation_nl "The current user ($(whoami)) does not have ownership of the following files:"
fn_script_log_info "The current user ($(whoami)) does not have ownership of the following files:"
{
echo -e "User\tGroup\tFile\n"
find "${rootdir}" -not -user $(whoami) -printf "%u\t\t%g\t%p\n"
find "${filesdir}" -not -user $(whoami) -printf "%u\t\t%g\t%p\n"
} | column -s $'\t' -t | tee -a "${scriptlog}"
core_exit.sh
fi

28
lgsm/functions/check_system_requirements.sh

@ -0,0 +1,28 @@
#!/bin/bash
# LGSM check_system_requirements.sh
# Author: Daniel Gibbs
# Contributor: UltimateByte
# Website: https://gameservermanagers.com
# Description: Checks RAM requirements
local commandname="CHECK"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
info_distro.sh
# RAM requirements in megabytes for each game or engine.
if [ "${gamename}" == "Rust" ]; then
ramrequirementmb="4000"
ramrequirementgb="4"
fi
# If the game or engine has a minimum RAM Requirement, compare it to system's available RAM.
if [ -n "${ramrequirement}" ]; then
if [ "${physmemtotalmb}" -lt "${ramrequirementmb}" ]; then
# Warn the user
fn_print_warn "Insufficient memory: ${ramrequirementgb}G required, ${physmemtotal} available"
sleep 1
fn_print_warning "You may experiance poor performance from your server"
sleep 1
fi
fi

10
lgsm/functions/command_details.sh

@ -42,8 +42,8 @@ fn_details_performance(){
# Uptime: 55d, 3h, 38m
# Avg Load: 1.00, 1.01, 0.78
#
# Mem: total used free
# Physical: 741M 656M 85M
# Mem: total used free cached
# Physical: 741M 656M 85M 256M
# Swap: 0B 0B 0B
echo -e ""
@ -55,8 +55,8 @@ fn_details_performance(){
} | column -s $'\t' -t
echo -e ""
{
echo -e "${blue}Mem:\t${blue}total\t used\t free${default}"
echo -e "${blue}Physical:\t${default}${physmemtotal}\t${physmemused}\t${physmemfree}${default}"
echo -e "${blue}Mem:\t${blue}total\t used\t free\t cached${default}"
echo -e "${blue}Physical:\t${default}${physmemtotal}\t${physmemused}\t${physmemfree}\t${physmemcached}${default}"
echo -e "${blue}Swap:\t${default}${swaptotal}\t${swapused}\t${swapfree}${default}"
} | column -s $'\t' -t
}
@ -615,4 +615,4 @@ else
fi
fn_details_statusbottom
core_exit.sh
core_exit.sh

6
lgsm/functions/command_validate.sh

@ -13,7 +13,7 @@ fn_validation(){
echo -en " * https://developer.valvesoftware.com/wiki/SteamCMD#Validate"
sleep 3
echo -en "\n"
fn_print_dots_nl "Validating files: SteamCMD"
fn_script_log_info "Validating files: SteamCMD"
sleep 1
@ -39,7 +39,9 @@ fn_validation(){
}
fn_print_dots "Validating files"
fn_print_dots_nl "Validating files:"
sleep 0.5
fn_print_dots_nl "Validating files: SteamCMD"
sleep 1
check.sh
check_status.sh

5
lgsm/functions/core_functions.sh

@ -222,6 +222,11 @@ functionfile="${FUNCNAME}"
fn_fetch_function
}
check_system_requirements.sh(){
functionfile="${FUNCNAME}"
fn_fetch_function
}
check_tmux.sh(){
functionfile="${FUNCNAME}"
fn_fetch_function

24
lgsm/functions/core_messages.sh

@ -25,8 +25,8 @@ fi
##########
## Feb 28 14:56:58 ut99-server: Monitor:
fn_script_log(){
if [ -n "${commandaction}" ]; then
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandaction}: ${1}" >> "${scriptlog}"
if [ -n "${commandname}" ]; then
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandname}: ${1}" >> "${scriptlog}"
else
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}"
fi
@ -34,8 +34,8 @@ fn_script_log(){
## Feb 28 14:56:58 ut99-server: Monitor: PASS:
fn_script_log_pass(){
if [ -n "${commandaction}" ]; then
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandaction}: PASS: ${1}" >> "${scriptlog}"
if [ -n "${commandname}" ]; then
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandname}: PASS: ${1}" >> "${scriptlog}"
else
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: PASS: ${1}" >> "${scriptlog}"
fi
@ -44,8 +44,8 @@ fn_script_log_pass(){
## Feb 28 14:56:58 ut99-server: Monitor: FATAL:
fn_script_log_fatal(){
if [ -n "${commandaction}" ]; then
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandaction}: FATAL: ${1}" >> "${scriptlog}"
if [ -n "${commandname}" ]; then
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandname}: FATAL: ${1}" >> "${scriptlog}"
else
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: FATAL: ${1}" >> "${scriptlog}"
fi
@ -54,8 +54,8 @@ fn_script_log_fatal(){
## Feb 28 14:56:58 ut99-server: Monitor: ERROR:
fn_script_log_error(){
if [ -n "${commandaction}" ]; then
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandaction}: ERROR: ${1}" >> "${scriptlog}"
if [ -n "${commandname}" ]; then
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandname}: ERROR: ${1}" >> "${scriptlog}"
else
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ERROR: ${1}" >> "${scriptlog}"
fi
@ -64,8 +64,8 @@ fn_script_log_error(){
## Feb 28 14:56:58 ut99-server: Monitor: WARN:
fn_script_log_warn(){
if [ -n "${commandaction}" ]; then
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandaction}: WARN: ${1}" >> "${scriptlog}"
if [ -n "${commandname}" ]; then
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandname}: WARN: ${1}" >> "${scriptlog}"
else
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: WARN: ${1}" >> "${scriptlog}"
fi
@ -74,8 +74,8 @@ fn_script_log_warn(){
## Feb 28 14:56:58 ut99-server: Monitor: INFO:
fn_script_log_info(){
if [ -n "${commandaction}" ]; then
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandaction}: INFO: ${1}" >> "${scriptlog}"
if [ -n "${commandname}" ]; then
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandname}: INFO: ${1}" >> "${scriptlog}"
else
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: INFO: ${1}" >> "${scriptlog}"
fi

82
lgsm/functions/info_config.sh

@ -161,6 +161,32 @@ fn_info_config_source(){
fi
}
fn_info_config_starbound(){
if [ ! -f "${servercfgfullpath}" ]; then
servername="${unavailable}"
rconpassword="${unavailable}"
port="21025"
queryport="21025"
rconport="21026"
slots="8"
else
servername=$(grep "serverName" "${servercfgfullpath}" | sed 's/"serverName" \: //g' | grep -oP '"\K[^"]+(?=["])')
rconpassword=$(grep "rconServerPassword" "${servercfgfullpath}" | sed 's/"rconServerPassword" \: //g' | grep -oP '"\K[^"]+(?=["])')
port=$(grep "gameServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
queryport=$(grep "queryServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
rconport=$(grep "rconServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
slots=$(grep "maxPlayers" "${servercfgfullpath}" | tr -cd '[:digit:]')
# Not Set
servername=${servername:-"NOT SET"}
rconpassword=${rconpassword:-"NOT SET"}
port=${port:-"21025"}
queryport=${queryport:-"21025"}
rconport=${rconport:-"21026"}
slots=${slots:-"8"}
fi
}
fn_info_config_teamspeak3(){
if [ ! -f "${servercfgfullpath}" ]; then
dbplugin="${unavailable}"
@ -267,7 +293,55 @@ fn_info_config_unreal(){
webadminpass=${webadminpass:-"NOT SET"}
fi
}
fn_info_config_sdtd(){
if [ ! -f "${servercfgfullpath}" ]; then
servername="${unavailable}"
serverpassword="${unavailable}"
port="${zero}"
queryport="${zero}"
webadminenabled="${unavailable}"
webadminport="${zero}"
webadminpass="${unavailable}"
telnetenabled="${unavailable}"
telnetport="${zero}"
telnetpass="${unavailable}"
slots="${unavailable}"
gamemode="${unavailable}"
gameworld="${unavailable}"
else
servername=$(grep "ServerName" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
serverpassword=$(grep "ServerPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
port=$(grep "ServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
queryport=$((port + 1))
webadminenabled=$(grep "ControlPanelEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
webadminport=$(grep "ControlPanelPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
webadminpass=$(grep "ControlPanelPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
telnetenabled=$(grep "TelnetEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
telnetport=$(grep "TelnetPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
telnetpass=$(grep "TelnetPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
slots=$(grep "ServerMaxPlayerCount" "${servercfgfullpath}" | tr -cd '[:digit:]')
gamemode=$(grep "GameMode" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
gameworld=$(grep "GameWorld" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
# Not Set
servername=${servername:-"NOT SET"}
serverpassword=${serverpassword:-"NOT SET"}
port=${port:-"0"}
queryport=${queryport:-"0"}
webadminenabled=${webadminenabled:-"NOT SET"}
webadminport=${webadminport:-"0"}
webadminpass=${webadminpass:-"NOT SET"}
telnetenabled=${telnetenabled:-"NOT SET"}
telnetport=${telnetport:-"0"}
telnetpass=${telnetpass:-"NOT SET"}
slots=${slots:-"NOT SET"}
gamemode=${gamemode:-"NOT SET"}
gameworld=${gameworld:-"NOT SET"}
fi
}
## Just Cause 2
if [ "${engine}" == "avalanche" ]; then
fn_info_config_avalanche
@ -289,6 +363,9 @@ elif [ "${engine}" == "seriousengine35" ]; then
# Source Engine Games
elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
fn_info_config_source
# Starbound
elif [ "${engine}" == "starbound" ]; then
fn_info_config_starbound
elif [ "${gamename}" == "Teamspeak 3" ]; then
fn_info_config_teamspeak3
# Teeworlds
@ -300,4 +377,7 @@ elif [ "${engine}" == "terraria" ]; then
# Unreal/Unreal 2 engine
elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
fn_info_config_unreal
fi
# 7 Day To Die (unity3d)
elif [ "${gamename}" == "7 Days To Die" ]; then
fn_info_config_sdtd
fi

5
lgsm/functions/info_distro.sh

@ -61,13 +61,14 @@ else
fi
physmemtotal=$(free ${humanreadable} | awk '/Mem:/ {print $2}')
physmemtotalmb=$(free -m | awk '/Mem:/ {print $2}')
physmemused=$(free ${humanreadable} | awk '/Mem:/ {print $3}')
physmemfree=$(free ${humanreadable} | awk '/Mem:/ {print $4}')
physmemcached=$(free ${humanreadable} | awk '/cache:/ {print $4}')
swaptotal=$(free ${humanreadable} | awk '/Swap:/ {print $2}')
swapused=$(free ${humanreadable} | awk '/Swap:/ {print $3}')
swapfree=$(free ${humanreadable} | awk '/Swap:/ {print $4}')
### Disk Infomation
## Available disk space on the partition.
@ -111,4 +112,4 @@ if [ -d "${backupdir}" ]; then
# size of most recent backup.
lastbackupsize=$(du -h "${lastbackup}" | awk '{print $1}')
fi
fi

26
lgsm/functions/info_parms.sh

@ -45,30 +45,6 @@ fn_info_config_source(){
clientport=${clientport:-"0"}
}
fn_info_config_teamspeak3(){
if [ ! -f "${servercfgfullpath}" ]; then
dbplugin="${unavailable}"
port="9987"
queryport="10011"
fileport="30033"
else
# check if the ip exists in the config file. Failing this will fall back to the default.
ipconfigcheck=$(grep "voice_ip=" "${servercfgfullpath}" | sed 's/\voice_ip=//g')
if [ -n "${ipconfigcheck}" ]; then
ip="${ipconfigcheck}"
fi
dbplugin=$(grep "dbplugin=" "${servercfgfullpath}" | sed 's/\dbplugin=//g')
port=$(grep "default_voice_port=" "${servercfgfullpath}" | tr -cd '[:digit:]')
queryport=$(grep "query_port=" "${servercfgfullpath}" | tr -cd '[:digit:]')
fileport=$(grep "filetransfer_port=" "${servercfgfullpath}" | tr -cd '[:digit:]')
# Not Set
port=${port:-"9987"}
queryport=${queryport:-"10011"}
fileport=${fileport:-"30033"}
fi
}
fn_info_config_teeworlds(){
if [ ! -f "${servercfgfullpath}" ]; then
servername="unnamed server"
@ -164,8 +140,6 @@ elif [ "${engine}" == "seriousengine35" ]; then
# Source Engine Games
elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
fn_info_config_source
elif [ "${gamename}" == "Teamspeak 3" ]; then
fn_info_config_teamspeak3
# Teeworlds
elif [ "${engine}" == "teeworlds" ]; then
fn_info_config_teeworlds

6
lgsm/functions/install_config.sh

@ -335,6 +335,12 @@ elif [ "${gamename}" == "Sven Co-op" ]; then
wget -N /dev/null ${githuburl}/SvenCoop/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq
sleep 1
fn_goldsourceconfig
elif [ "${gamename}" == "Starbound" ]; then
echo -e "downloading lgsm-default.config...\c"
wget -N /dev/null ${githuburl}/Starbound/cfg/lgsm-default.config 2>&1 | grep -F HTTP | cut -c45- | uniq
sleep 1
fn_defaultconfig
fn_userinputconfig
elif [ "${gamename}" == "Teamspeak 3" ]; then
echo -e "downloading lgsm-default.ini...\c"
wget -N /dev/null ${githuburl}/TeamSpeak3/cfg/lgsm-default.ini 2>&1 | grep -F HTTP | cut -c45- | uniq

33
lgsm/functions/install_gsquery.sh

@ -1,33 +0,0 @@
#!/bin/bash
# LGSM install_gsquery.sh function
# Author: Daniel Gibbs
# Website: https://gameservermanagers.com
local commandname="INSTALL"
local commandaction="Install"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
fn_dlgsquery(){
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
}
if [ "${engine}" == "avalanche" ]||[ "${engine}" == "goldsource" ]||[ "${engine}" == "idtech3" ]||[ "${engine}" == "realvirtuality" ]||[ "${engine}" == "source" ]||[ "${engine}" == "spark" ]||[ "${engine}" == "unity3d" ]||[ "${gamename}" == "Hurtworld" ]||[ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
echo ""
echo "GameServerQuery"
echo "================================="
if [ -z ${autoinstall} ]; then
while true; do
read -e -i "y" -p "Do you want to install GameServerQuery? [Y/n]" yn
case $yn in
[Yy]* ) fn_dlgsquery;break;;
[Nn]* ) echo ""; echo "Not installing GameServerQuery.";break;;
* ) echo "Please answer yes or no.";;
esac
done
else
fn_dlgsquery
fi
fi

28
lgsm/functions/update_ts3.sh

@ -1,8 +1,8 @@
#!/bin/bash
# LGSM command_update.sh function
# LGSM command_ts3.sh function
# Author: Daniel Gibbs
# Website: https://gameservermanagers.com
# Description:Handles updating of teamspeak 3 servers.
# Description: Handles updating of teamspeak 3 servers.
local commandname="UPDATE"
local commandaction="Update"
@ -22,9 +22,6 @@ fn_update_ts3_dl(){
fi
}
fn_update_ts3_currentbuild(){
# Gets currentbuild info
# Checks currentbuild info is available, if fails a server restart will be forced to generate logs.
@ -33,10 +30,10 @@ fn_update_ts3_currentbuild(){
sleep 1
fn_print_error_nl "Checking for update: teamspeak.com: No logs with server version found"
fn_script_log_error "Checking for update: teamspeak.com: No logs with server version found"
sleep 2
sleep 1
fn_print_info_nl "Checking for update: teamspeak.com: Forcing server restart"
fn_script_log_info "Checking for update: teamspeak.com: Forcing server restart"
sleep 2
sleep 1
exitbypass=1
command_stop.sh
exitbypass=1
@ -51,6 +48,23 @@ fn_update_ts3_currentbuild(){
fi
currentbuild=$(cat $(find ./* -name 'ts3server*_0.log' 2> /dev/null | sort | egrep -E -v '${rootdir}/.ts3version' | tail -1) | egrep -o 'TeamSpeak 3 Server ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | egrep -o '((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}')
if [ -z "${currentbuild}" ]; then
fn_print_error_nl "Checking for update: teamspeak.com: Current build version not found"
fn_script_log_error "Checking for update: teamspeak.com: Current build version not found"
sleep 1
fn_print_info_nl "Checking for update: teamspeak.com: Forcing server restart"
fn_script_log_info "Checking for update: teamspeak.com: Forcing server restart"
exitbypass=1
command_stop.sh
exitbypass=1
command_start.sh
currentbuild=$(cat $(find ./* -name 'ts3server*_0.log' 2> /dev/null | sort | egrep -E -v '${rootdir}/.ts3version' | tail -1) | egrep -o 'TeamSpeak 3 Server ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | egrep -o '((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}')
if [ -z "${currentbuild}" ]; then
fn_print_fail_nl "Checking for update: teamspeak.com: Current build version still not found"
fn_script_log_fatal "Checking for update: teamspeak.com: Current build version still not found"
core_exit.sh
fi
fi
}
fn_update_ts3_arch(){

Loading…
Cancel
Save