diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 000000000..802343b27
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,22 @@
+# crlf line endings for text files
+* text eol=lf
+
+# Denote all files that are truly binary and should not be modified.
+*.png binary
+*.jpg binary
+*.so.6 binary
+
+# Custom for Visual Studio
+*.cs diff=csharp
+
+# Standard to msysgit
+*.doc diff=astextplain
+*.DOC diff=astextplain
+*.docx diff=astextplain
+*.DOCX diff=astextplain
+*.dot diff=astextplain
+*.DOT diff=astextplain
+*.pdf diff=astextplain
+*.PDF diff=astextplain
+*.rtf diff=astextplain
+*.RTF diff=astextplain
\ No newline at end of file
diff --git a/README.md b/README.md
index c7d0c8beb..5ba974010 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,7 @@
[](https://linuxgsm.com)
[](https://travis-ci.org/GameServerManagers/LinuxGSM)
+[](https://app.codacy.com/app/GameServerManagers/LinuxGSM?utm_source=github.com&utm_medium=referral&utm_content=GameServerManagers/LinuxGSM&utm_campaign=Badge_Grade_Dashboard)
[](http://waffle.io/GameServerManagers/LinuxGSM)
[](https://linuxgsm.com/discord)
[](https://github.com/GameServerManagers/LinuxGSM/blob/master/LICENSE)
@@ -60,4 +61,4 @@ If you want to donate to the project you can via PayPal. I have had a may kind p
Twitter
Facebook
Google+
-
\ No newline at end of file
+
diff --git a/lgsm/config-default/config-lgsm/arkserver/_default.cfg b/lgsm/config-default/config-lgsm/arkserver/_default.cfg
index 077dff9d2..e57c873d1 100644
--- a/lgsm/config-default/config-lgsm/arkserver/_default.cfg
+++ b/lgsm/config-default/config-lgsm/arkserver/_default.cfg
@@ -13,11 +13,12 @@ ip="0.0.0.0"
port="7777"
queryport="27015"
rconport="27020"
+defaultmap="TheIsland"
maxplayers="70"
## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters
fn_parms(){
-parms="\"TheIsland?listen?MultiHome=${ip}?MaxPlayers=${maxplayers}?QueryPort=${queryport}?RCONPort=${rconport}?Port=${port}?\""
+parms="\"${defaultmap}?listen?MultiHome=${ip}?MaxPlayers=${maxplayers}?QueryPort=${queryport}?RCONPort=${rconport}?Port=${port}?\""
}
#### LinuxGSM Settings ####
diff --git a/lgsm/config-default/config-lgsm/csgoserver/_default.cfg b/lgsm/config-default/config-lgsm/csgoserver/_default.cfg
index ed790f3e1..c19233e41 100644
--- a/lgsm/config-default/config-lgsm/csgoserver/_default.cfg
+++ b/lgsm/config-default/config-lgsm/csgoserver/_default.cfg
@@ -17,6 +17,7 @@
# Custom 3 0
# Deathmatch 1 2
# Demolition 1 1
+# Wingman 0 2
gametype="0"
gamemode="0"
mapgroup="mg_active"
@@ -41,7 +42,7 @@ wsstartmap=""
## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters
fn_parms(){
-parms="-game csgo -usercon -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} -tickrate ${tickrate} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers_override ${maxplayers} +mapgroup ${mapgroup} +game_mode ${gamemode} +game_type ${gametype} +host_workshop_collection ${wscollectionid} +workshop_start_map ${wsstartmap} -authkey ${wsapikey} -nobreakpad"
+parms="-game csgo -usercon -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} -tickrate ${tickrate} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers_override ${maxplayers} +mapgroup ${mapgroup} +game_type ${gametype} +game_mode ${gamemode} +host_workshop_collection ${wscollectionid} +workshop_start_map ${wsstartmap} -authkey ${wsapikey} -nobreakpad"
}
#### LinuxGSM Settings ####
diff --git a/lgsm/config-default/config-lgsm/fctrserver/_default.cfg b/lgsm/config-default/config-lgsm/fctrserver/_default.cfg
index 2632e7717..91aec48b1 100644
--- a/lgsm/config-default/config-lgsm/fctrserver/_default.cfg
+++ b/lgsm/config-default/config-lgsm/fctrserver/_default.cfg
@@ -13,6 +13,7 @@ ip="0.0.0.0"
port="34197"
rconport="34198"
rconpassword="CHANGE_ME"
+# (stable|experimental)
branch="stable"
## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters
diff --git a/lgsm/config-default/config-lgsm/wurmserver/_default.cfg b/lgsm/config-default/config-lgsm/wurmserver/_default.cfg
new file mode 100644
index 000000000..5e7e435ca
--- /dev/null
+++ b/lgsm/config-default/config-lgsm/wurmserver/_default.cfg
@@ -0,0 +1,121 @@
+##################################
+######## Default Settings ########
+##################################
+# DO NOT EDIT WILL BE OVERWRITTEN!
+# Copy settings from here and use them in either
+# common.cfg - applies settings to every instance
+# [instance].cfg - applies settings to a specific instance
+
+#### Server Settings ####
+
+## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters
+fn_parms(){
+ # Note Parameters are editing in the game server config file.
+ source "${servercfgfullpath}"
+ parms="ADMINPWD=\"$ADMINPWD\" EPICSETTINGS=\"$EPICSETTINGS\" EXTERNALPORT=\"$EXTERNALPORT\" HOMESERVER=\"$HOMESERVER\" HOMEKINGDOM=\"$HOMEKINGDOM\" LOGINSERVER=\"$LOGINSERVER\" MAXPLAYERS=\"$MAXPLAYERS\" QUERYPORT=\"$QUERYPORT\" SERVERNAME=\"$SERVERNAME\" SERVERPASSWORD=\"$SERVERPASSWORD\" START=\"$START\" IP=\"$IP\""
+}
+
+#### LinuxGSM Settings ####
+
+## Notification Alerts
+# (on|off)
+
+# More info | https://github.com/GameServerManagers/LinuxGSM/wiki/Alerts#more-info
+postalert="off"
+postdays="7"
+posttarget="https://hastebin.com"
+
+# Discord Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Discord
+discordalert="off"
+discordwebhook="webhook"
+
+# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email
+emailalert="off"
+email="email@example.com"
+emailfrom=""
+
+# IFTTT Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/IFTTT
+iftttalert="off"
+ifttttoken="accesstoken"
+iftttevent="linuxgsm_alert"
+
+# Mailgun Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/mailgun
+mailgunalert="off"
+mailguntoken="accesstoken"
+mailgundomain="example.com"
+mailgunemailfrom="alert@example.com"
+mailgunemail="email@myemail.com"
+
+# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+channeltag=""
+
+# Pushover Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushover
+pushoveralert="off"
+pushovertoken="accesstoken"
+
+# Telegram Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Telegram
+# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring".
+# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need
+# any custom string in curl - simple ignore this parameter.
+telegramalert="off"
+telegramtoken="accesstoken"
+telegramchatid=""
+curlcustomstring=""
+
+## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup
+maxbackups="4"
+maxbackupdays="30"
+stoponbackup="on"
+
+## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging
+consolelogging="on"
+logdays="7"
+
+#### LinuxGSM Advanced Settings ####
+
+# ANSI Colors
+ansi="on"
+
+## SteamCMD Settings
+# Server appid
+appid="402370"
+# Steam App Branch Select
+# Allows to opt into the various Steam app branches. Default branch is "".
+# Example: "-beta latest_experimental"
+branch=""
+
+## LinuxGSM Server Details
+# Do not edit
+gamename="Wurm Unlimited"
+engine="wurm"
+
+#### Directories ####
+# Edit with care
+
+## Server Specific Directories
+systemdir="${serverfiles}"
+executabledir="${systemdir}"
+executable="xvfb-run ./WurmServerLauncher"
+servercfg="${servicename}.cfg"
+servercfgdefault="server.cfg"
+servercfgdir="${systemdir}"
+servercfgfullpath="${servercfgdir}/${servercfg}"
+
+## Backup Directory
+backupdir="${rootdir}/backups"
+
+## Logging Directories
+logdir="${rootdir}/log"
+gamelogdir="${serverfiles}/Logs"
+lgsmlogdir="${logdir}/script"
+consolelogdir="${logdir}/console"
+lgsmlog="${lgsmlogdir}/${servicename}-script.log"
+consolelog="${consolelogdir}/${servicename}-console.log"
+alertlog="${lgsmlogdir}/${servicename}-alert.log"
+postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log"
+
+## Logs Naming
+lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log"
+consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log"
diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv
index 962cd77b6..12bb0532c 100644
--- a/lgsm/data/serverlist.csv
+++ b/lgsm/data/serverlist.csv
@@ -79,5 +79,6 @@ ut3,ut3server,Unreal Tournament 3
ut99,ut99server,Unreal Tournament 99
vs,vsserver,Vampire Slayer
wet,wetserver,Wolfenstein: Enemy Territory
+wurm,wurmserver,Wurm Unlimited
etl,etlserver,ET: Legacy
zps,zpsserver,Zombie Panic! Source
diff --git a/lgsm/functions/check.sh b/lgsm/functions/check.sh
index 5814a823d..99c8890e5 100644
--- a/lgsm/functions/check.sh
+++ b/lgsm/functions/check.sh
@@ -10,11 +10,16 @@ local commandname="CHECK"
# Every command that requires checks just references check.sh
# check.sh selects which checks to run by using arrays
-check_root.sh
+if [ "${userinput}" != "install" ]&&[ "${userinput}" != "auto-install" ]&&[ "${userinput}" != "i" ]&&[ "${userinput}" != "ai" ]; then
+ check_root.sh
+fi
+
check_tmuxception.sh
-if [ "${function_selfname}" != "command_monitor.sh" ]; then
- check_permissions.sh
+if [ "$(whoami)" != "root" ]; then
+ if [ "${function_selfname}" != "command_monitor.sh" ]; then
+ check_permissions.sh
+ fi
fi
if [ "${function_selfname}" != "command_install.sh" ]&&[ "${function_selfname}" != "command_update_functions.sh" ]&&[ "${function_selfname}" != "command_update_linuxgsm.sh" ]&&[ "${function_selfname}" != "command_details.sh" ]&&[ "${function_selfname}" != "command_postdetails.sh" ]; then
@@ -29,13 +34,15 @@ do
fi
done
-local allowed_commands_array=( command_debug.sh command_start.sh command_install.sh )
-for allowed_command in "${allowed_commands_array[@]}"
-do
- if [ "${allowed_command}" == "${function_selfname}" ]; then
- check_glibc.sh
- fi
-done
+if [ "$(whoami)" != "root" ]; then
+ local allowed_commands_array=( command_debug.sh command_start.sh command_install.sh )
+ for allowed_command in "${allowed_commands_array[@]}"
+ do
+ if [ "${allowed_command}" == "${function_selfname}" ]; then
+ check_glibc.sh
+ fi
+ done
+fi
local allowed_commands_array=( command_backup.sh command_console.sh command_debug.sh command_details.sh command_unreal2_maps.sh command_fastdl.sh command_mods_install.sh command_mods_remove.sh command_mods_update.sh command_monitor.sh command_postdetails.sh command_restart.sh command_start.sh command_stop.sh command_test_alert.sh command_ts3_server_pass.sh command_update.sh command_update_functions.sh command_validate.sh command_wipe.sh command_unreal2_maps.sh command_ut99maps.sh)
for allowed_command in "${allowed_commands_array[@]}"
@@ -61,7 +68,7 @@ do
fi
done
-local allowed_commands_array=( command_debug.sh command_details.sh command_monitor.sh command_start.sh command_stop.sh command_dev_query_raw.sh )
+local allowed_commands_array=( command_debug.sh command_details.sh command_postdetails.sh command_monitor.sh command_start.sh command_stop.sh command_dev_query_raw.sh )
for allowed_command in "${allowed_commands_array[@]}"
do
if [ "${allowed_command}" == "${function_selfname}" ]; then
diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh
index 24e20b35e..410483480 100644
--- a/lgsm/functions/check_deps.sh
+++ b/lgsm/functions/check_deps.sh
@@ -95,6 +95,39 @@ fn_install_mono_repo(){
fi
}
+fn_install_universe_repo(){
+ # Defensive coding - As this is an ubuntu only issue then check to make sure this fix is needed, and we are using ubuntu
+ if [ "${jquniversemissing}" != "0" ]&&[ "${distroid}" == "ubuntu" ]; then
+ fn_print_warning_nl "Ubuntu 18.04.1 contains a bug which means the sources.list file does not populate with the Ubuntu universe repository."
+ fn_print_information_nl "Attempting to add Universe Repo"
+ sleep 0.5
+ sudo -v > /dev/null 2>&1
+ if [ $? -eq 0 ]; then
+ echo -en ".\r"
+ sleep 1
+ echo -en "..\r"
+ sleep 1
+ echo -en "...\r"
+ sleep 1
+ echo -en " \r"
+ cmd="sudo apt-add-repository universe"
+ eval ${cmd}
+ if [ $? -eq 0 ]; then
+ fn_print_complete_nl "Installing universe repository completed."
+ fn_script_log_pass "Installing universe repository completed."
+ else
+ fn_print_failure_nl "Unable to install universe repository."
+ fn_script_log_fatal "Unable to install universe repository."
+ fi
+ else
+ fn_print_warning_nl "$(whoami) does not have sudo access. Manually add Universe repository."
+ fn_script_log_warn "$(whoami) does not have sudo access. Manually add Universe repository."
+ echo " Please run the following command as a user with sudo access, and re-run the installation"
+ echo " sudo apt-add-repository universe"
+ fi
+ fi
+}
+
fn_deps_detector(){
# Checks if dependency is missing
if [ "${tmuxcheck}" == "1" ]; then
@@ -109,6 +142,11 @@ fn_deps_detector(){
unset javacheck
elif [ "${deptocheck}" == "jq" ]&&[ "${distroversion}" == "6" ]; then
jqstatus=1
+ elif [ "${deptocheck}" == "jq" ]&&[ "${distroid}" == "ubuntu" ]&&[ "${distroversion}" == "18.04" ]&& ! grep -qE "^deb .*universe" /etc/apt/sources.list; then
+ #1985 ubuntu 18.04.1 bug does not set sources.list correctly which means universe is not active by default
+ #If the universe repo does not exist, mark as dependency missing and universe missing
+ depstatus=1
+ jquniversemissing=1
elif [ "${deptocheck}" == "mono-complete" ]; then
if [ "$(command -v mono 2>/dev/null)" ]&&[ "$(mono --version 2>&1 | grep -Po '(?<=version )\d')" -ge 5 ]; then
# Mono >= 5.0.0 already installed
@@ -361,7 +399,7 @@ fn_deps_build_debian(){
array_deps_required+=( libxrandr2:i386 libglu1-mesa:i386 libxtst6:i386 libusb-1.0-0-dev:i386 libxxf86vm1:i386 libopenal1:i386 libssl1.0.0:i386 libgtk2.0-0:i386 libdbus-glib-1-2:i386 libnm-glib-dev:i386 )
# Sven Co-op
elif [ "${shortname}" == "sven" ]; then
- array_deps_required+=( libssl1.0.0:i386 )
+ array_deps_required+=( libssl1.0.0:i386 zlib1g:i386 )
# Unreal Engine
elif [ "${executable}" == "./ucc-bin" ]; then
#UT2K4
diff --git a/lgsm/functions/check_ip.sh b/lgsm/functions/check_ip.sh
index 47f14de4e..ba2d472c1 100644
--- a/lgsm/functions/check_ip.sh
+++ b/lgsm/functions/check_ip.sh
@@ -6,7 +6,6 @@
# If multiple interfaces are detected the user will need to manually set using ip="0.0.0.0".
local commandname="CHECK"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${gamename}" != "Mumble" ]&&[ "${travistest}" != "1" ]; then
if [ ! -f "/bin/ip" ]; then
@@ -25,7 +24,11 @@ if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${gamename}" != "Mumble" ]&&[ "${travi
sleep 0.5
# Multiple interfaces
if [ "${getipwc}" -ge "2" ]; then
- fn_print_fail "Check IP: Multiple IP addresses found."
+ if [ "${function_selfname}" == "command_details.sh" ]; then
+ fn_print_warn "Check IP: Multiple IP addresses found."
+ else
+ fn_print_fail "Check IP: Multiple IP addresses found."
+ fi
sleep 0.5
echo -en "\n"
# IP is set within game config
@@ -54,7 +57,7 @@ if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${gamename}" != "Mumble" ]&&[ "${travi
echo -en "https://linuxgsm.com/network-interfaces\n"
echo -en ""
# Do not exit for details and postdetails commands
- if [ "${commandaction}" != "Details" ]&&[ "${commandaction}" != "Postdetails" ]; then
+ if [ "${function_selfname}" != "command_details.sh" ]||[ "${function_selfname}" != "command_postdetails.sh" ]; then
fn_script_log_fatal "https://linuxgsm.com/network-interfaces\n"
core_exit.sh
else
@@ -76,7 +79,9 @@ if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${gamename}" != "Mumble" ]&&[ "${travi
fn_script_log_fatal "IP address not set in game config."
fn_script_log_fatal "Specify the IP you want to bind within: ${servercfgfullpath}."
fn_script_log_fatal "https://linuxgsm.com/network-interfaces\n"
- core_exit.sh
+ if [ "${function_selfname}" != "command_details.sh" ];then
+ core_exit.sh
+ fi
else
fn_print_info_nl "Check IP: ${getip}"
fn_script_log_info "IP automatically set as: ${getip}"
diff --git a/lgsm/functions/check_permissions.sh b/lgsm/functions/check_permissions.sh
index 7498925e1..0cc206b19 100644
--- a/lgsm/functions/check_permissions.sh
+++ b/lgsm/functions/check_permissions.sh
@@ -230,8 +230,10 @@ fn_sys_perm_error_process(){
# Run perm error detect & fix/alert functions on /sys directories
## Run checks
-fn_check_ownership
-fn_check_permissions
-if [ "${function_selfname}" == "command_start.sh" ]; then
- fn_sys_perm_error_process
+if [ "$(whoami)" != "root" ]; then
+ fn_check_ownership
+ fn_check_permissions
+ if [ "${function_selfname}" == "command_start.sh" ]; then
+ fn_sys_perm_error_process
+ fi
fi
diff --git a/lgsm/functions/check_root.sh b/lgsm/functions/check_root.sh
index a58782515..b5d20cf24 100644
--- a/lgsm/functions/check_root.sh
+++ b/lgsm/functions/check_root.sh
@@ -8,9 +8,11 @@ local commandname="CHECK"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ "$(whoami)" = "root" ]; then
- fn_print_fail_nl "Do NOT run this script as root!"
- if [ -d "${lgsmlogdir}" ]; then
- fn_script_log_fatal "${selfname} attempted to run as root."
+ if [ "${function_selfname}" != "command_install.sh" ]; then
+ fn_print_fail_nl "Do NOT run this script as root!"
+ if [ -d "${lgsmlogdir}" ]; then
+ fn_script_log_fatal "${selfname} attempted to run as root."
+ fi
+ core_exit.sh
fi
- core_exit.sh
fi
diff --git a/lgsm/functions/check_status.sh b/lgsm/functions/check_status.sh
index 4fb1bfa31..61d1d030d 100644
--- a/lgsm/functions/check_status.sh
+++ b/lgsm/functions/check_status.sh
@@ -8,7 +8,7 @@
local commandname="CHECK"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
-if [ "${gamename}" == "TeamSpeak 3" ]; then
+if [ "${shortname}" == "ts3" ]; then
# 1: Server is running
# 0: Server seems to have died
# 0: No server running (ts3server.pid is missing)
@@ -19,18 +19,6 @@ if [ "${gamename}" == "TeamSpeak 3" ]; then
ts3error="${status}"
status=0
fi
-
-elif [ "${gamename}" == "Mumble" ]; then
- # Get config info
- info_config.sh
- # 1: Server is listening
- # 0: Server is not listening, considered closed
- mumblepid=$(netstat -nap 2>/dev/null | grep udp | grep "${port}" | grep murmur | awk '{ print $6 }' | awk -F'/' '{ print $1 }')
- if [ -z "${mumblepid}" ]; then
- status=0
- else
- status=1
- fi
else
status=$(tmux list-sessions -F "#{session_name}" 2>/dev/null | grep -Ecx "^${servicename}")
fi
diff --git a/lgsm/functions/command_backup.sh b/lgsm/functions/command_backup.sh
index b2df4be6d..0f2b09b4d 100644
--- a/lgsm/functions/command_backup.sh
+++ b/lgsm/functions/command_backup.sh
@@ -14,12 +14,12 @@ check.sh
# Trap to remove lockfile on quit.
fn_backup_trap(){
echo ""
- echo -ne "backup ${backupname}.tar.gz..."
+ echo -en "backup ${backupname}.tar.gz..."
fn_print_canceled_eol_nl
fn_script_log_info "Backup ${backupname}.tar.gz: CANCELED"
sleep 0.5
rm -f "${backupdir}/${backupname}.tar.gz" | tee -a "${lgsmlog}"
- echo -ne "backup ${backupname}.tar.gz..."
+ echo -en "backup ${backupname}.tar.gz..."
fn_print_removed_eol_nl
fn_script_log_info "Backup ${backupname}.tar.gz: REMOVED"
# Remove lock file
@@ -47,7 +47,7 @@ fn_backup_init(){
sleep 0.5
fn_print_ok "Backup starting"
sleep 0.5
- echo -ne "\n"
+ echo -en "\n"
if [ ! -d "${backupdir}" ]||[ "${backupcount}" == "0" ]; then
fn_print_info_nl "There are no previous backups"
else
diff --git a/lgsm/functions/command_debug.sh b/lgsm/functions/command_debug.sh
index c3d8d32d1..453c42894 100644
--- a/lgsm/functions/command_debug.sh
+++ b/lgsm/functions/command_debug.sh
@@ -51,6 +51,11 @@ if [ -n "${glibcrequired}" ]; then
fi
fi
# Server ip
+if [ "${multiple_ip}" == "1" ]; then
+ echo -e "${blue}Server IP:\t${default}NOT SET"
+else
+ echo -e "${blue}Server IP:\t${default}${ip}:${port}"
+fi
echo -e "${blue}Server IP:\t${default}${ip}:${port}"
# External server ip
if [ -n "${extip}" ]; then
diff --git a/lgsm/functions/command_dev_detect_deps.sh b/lgsm/functions/command_dev_detect_deps.sh
index 8f3949b37..d0dae61b2 100644
--- a/lgsm/functions/command_dev_detect_deps.sh
+++ b/lgsm/functions/command_dev_detect_deps.sh
@@ -36,58 +36,100 @@ sort "${tmpdir}/.depdetect_readelf" |uniq >"${tmpdir}/.depdetect_readelf_uniq"
while read -r lib; do
echo "${lib}"
- if [ "${lib}" == "libm.so.6" ]||[ "${lib}" == "libc.so.6" ]||[ "${lib}" == "libtcmalloc_minimal.so.4" ]||[ "${lib}" == "libpthread.so.0" ]||[ "${lib}" == "libdl.so.2" ]||[ "${lib}" == "libnsl.so.1" ]||[ "${lib}" == "libgcc_s.so.1" ]||[ "${lib}" == "librt.so.1" ]||[ "${lib}" == "ld-linux.so.2" ]; then
- echo "glibc.i686" >> "${tmpdir}/.depdetect_centos_list"
- echo "lib32gcc1" >> "${tmpdir}/.depdetect_ubuntu_list"
- echo "lib32gcc1" >> "${tmpdir}/.depdetect_debian_list"
- elif [ "${lib}" == "libstdc++.so.6" ]; then
+ local libs_array=( libm.so.6 libc.so.6 libtcmalloc_minimal.so.4 libpthread.so.0 libdl.so.2 libnsl.so.1 libgcc_s.so.1 librt.so.1 ld-linux.so.2 libdbus-glib-1.so.2 libgio-2.0.so.0 libglib-2.0.so.0 libGL.so.1 libgobject-2.0.so.0 libnm-glib.so.4 libnm-util.so.2 )
+ for lib_file in "${libs_array[@]}"
+ do
+ if [ "${lib}" == "${lib_file}" ]; then
+ echo "glibc.i686" >> "${tmpdir}/.depdetect_centos_list"
+ echo "lib32gcc1" >> "${tmpdir}/.depdetect_ubuntu_list"
+ echo "lib32gcc1" >> "${tmpdir}/.depdetect_debian_list"
+ libdetected=1
+ fi
+ done
+
+ local libs_array=( libawt.so libjava.so libjli.so libjvm.so libnet.so libnio.so libverify.so )
+ for lib_file in "${libs_array[@]}"
+ do
+ if [ "${lib}" == "${lib_file}" ]; then
+ echo "java-1.8.0-openjdk" >> "${tmpdir}/.depdetect_centos_list"
+ echo "default-jre" >> "${tmpdir}/.depdetect_ubuntu_list"
+ echo "default-jre" >> "${tmpdir}/.depdetect_debian_list"
+ libdetected=1
+ fi
+ done
+
+ local libs_array=( libtier0.so libtier0_srv.so libvstdlib_srv.so Core.so libvstdlib.so libtier0_s.so Editor.so Engine.so liblua.so libsteam_api.so ld-linux-x86-64.so.2 libPhysX3_x86.so libPhysX3Common_x86.so libPhysX3Cooking_x86.so)
+ for lib_file in "${libs_array[@]}"
+ do
+ # Known shared libs what dont requires dependencies
+ if [ "${lib}" == "${lib_file}" ]; then
+ libdetected=1
+ fi
+ done
+
+ if [ "${lib}" == "libstdc++.so.6" ]; then
echo "libstdc++.i686" >> "${tmpdir}/.depdetect_centos_list"
echo "libstdc++6:i386" >> "${tmpdir}/.depdetect_ubuntu_list"
echo "libstdc++6:i386" >> "${tmpdir}/.depdetect_debian_list"
+ libdetected=1
elif [ "${lib}" == "libstdc++.so.5" ]; then
echo "compat-libstdc++-33.i686" >> "${tmpdir}/.depdetect_centos_list"
echo "libstdc++5:i386" >> "${tmpdir}/.depdetect_ubuntu_list"
echo "libstdc++5:i386" >> "${tmpdir}/.depdetect_debian_list"
+ libdetected=1
elif [ "${lib}" == "libcurl-gnutls.so.4" ]; then
echo "libcurl.i686" >> "${tmpdir}/.depdetect_centos_list"
echo "libcurl4-gnutls-dev:i386" >> "${tmpdir}/.depdetect_ubuntu_list"
echo "libcurl4-gnutls-dev:i386" >> "${tmpdir}/.depdetect_debian_list"
+ libdetected=1
elif [ "${lib}" == "libspeex.so.1" ]||[ "${lib}" == "libspeexdsp.so.1" ]; then
echo "speex.i686" >> "${tmpdir}/.depdetect_centos_list"
echo "speex:i386" >> "${tmpdir}/.depdetect_ubuntu_list"
echo "speex:i386" >> "${tmpdir}/.depdetect_debian_list"
+ libdetected=1
elif [ "${lib}" == "./libSDL-1.2.so.0" ]||[ "${lib}" == "libSDL-1.2.so.0" ]; then
echo "SDL.i686" >> "${tmpdir}/.depdetect_centos_list"
echo "libsdl1.2debian" >> "${tmpdir}/.depdetect_ubuntu_list"
echo "libsdl1.2debian" >> "${tmpdir}/.depdetect_debian_list"
+ libdetected=1
elif [ "${lib}" == "libtbb.so.2" ]; then
echo "tbb.i686" >> "${tmpdir}/.depdetect_centos_list"
echo "libtbb2" >> "${tmpdir}/.depdetect_ubuntu_list"
echo "libtbb2" >> "${tmpdir}/.depdetect_debian_list"
- elif [ "${lib}" == "libawt.so" ]||[ "${lib}" == "libjava.so" ]||[ "${lib}" == "libjli.so" ]||[ "${lib}" == "libjvm.so" ]||[ "${lib}" == "libnet.so" ]||[ "${lib}" == "libnio.so" ]||[ "${lib}" == "libverify.so" ]; then
- echo "java-1.8.0-openjdk" >> "${tmpdir}/.depdetect_centos_list"
- echo "default-jre" >> "${tmpdir}/.depdetect_ubuntu_list"
- echo "default-jre" >> "${tmpdir}/.depdetect_debian_list"
+ libdetected=1
+
elif [ "${lib}" == "libXrandr.so.2" ]; then
echo "libXrandr" >> "${tmpdir}/.depdetect_centos_list"
echo "libxrandr2" >> "${tmpdir}/.depdetect_ubuntu_list"
echo "libxrandr2" >> "${tmpdir}/.depdetect_debian_list"
+ libdetected=1
elif [ "${lib}" == "libXext.so.6" ]; then
echo "libXext" >> "${tmpdir}/.depdetect_centos_list"
echo "libxext6" >> "${tmpdir}/.depdetect_ubuntu_list"
echo "libxext6" >> "${tmpdir}/.depdetect_debian_list"
+ libdetected=1
elif [ "${lib}" == "libXtst.so.6" ]; then
echo "libXtst" >> "${tmpdir}/.depdetect_centos_list"
echo "libxtst6" >> "${tmpdir}/.depdetect_ubuntu_list"
echo "libxtst6" >> "${tmpdir}/.depdetect_debian_list"
+ libdetected=1
+ elif [ "${lib}" == "libpulse.so.0" ]; then
+ echo "pulseaudio-libs" >> "${tmpdir}/.depdetect_centos_list"
+ echo "libpulse0" >> "${tmpdir}/.depdetect_ubuntu_list"
+ echo "libpulse0" >> "${tmpdir}/.depdetect_debian_list"
+ libdetected=1
+ elif [ "${lib}" == "libopenal.so.1" ]; then
+ echo "" >> "${tmpdir}/.depdetect_centos_list"
+ echo "libopenal1" >> "${tmpdir}/.depdetect_ubuntu_list"
+ echo "libopenal1" >> "${tmpdir}/.depdetect_debian_list"
+ libdetected=1
+ fi
- elif [ "${lib}" == "libtier0.so" ]||[ "${lib}" == "libtier0_srv.so" ]||[ "${lib}" == "libvstdlib_srv.so" ]||[ "${lib}" == "Core.so" ]||[ "${lib}" == "libvstdlib.so" ]||[ "${lib}" == "libtier0_s.so" ]||[ "${lib}" == "Editor.so" ]||[ "${lib}" == "Engine.so" ]||[ "${lib}" == "liblua.so" ]||[ "${lib}" == "libsteam_api.so" ]||[ "${lib}" == "ld-linux-x86-64.so.2" ]||[ "${lib}" == "libPhysX3_x86.so" ]||[ "${lib}" == "libPhysX3Common_x86.so" ]||[ "${lib}" == "libPhysX3Cooking_x86.so" ]; then
- # Known shared libs what dont requires dependencies
- :
- else
+ if [ "${libdetected}" != "1" ]; then
unknownlib=1
echo "${lib}" >> "${tmpdir}/.depdetect_unknown"
fi
+ unset libdetected
done < "${tmpdir}/.depdetect_readelf_uniq"
sort "${tmpdir}/.depdetect_centos_list" | uniq >> "${tmpdir}/.depdetect_centos_list_uniq"
diff --git a/lgsm/functions/command_install.sh b/lgsm/functions/command_install.sh
index 275055a5b..ba4059649 100644
--- a/lgsm/functions/command_install.sh
+++ b/lgsm/functions/command_install.sh
@@ -10,37 +10,41 @@ local commandaction="Install"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
check.sh
-install_header.sh
-install_server_dir.sh
-install_logs.sh
-check_deps.sh
-installflag=1
-# Download and install
-if [ "${gamename}" == "Unreal Tournament 2004" ]; then
- install_server_files.sh
- install_ut2k4_key.sh
-elif [ -z "${appid}" ]; then
- installer=1
- install_server_files.sh
-elif [ -n "${appid}" ]; then
- install_steamcmd.sh
- install_server_files.sh
-fi
+if [ "$(whoami)" = "root" ]; then
+ check_deps.sh
+else
+ install_header.sh
+ install_server_dir.sh
+ install_logs.sh
+ check_deps.sh
+ installflag=1
+ # Download and install
+ if [ "${gamename}" == "Unreal Tournament 2004" ]; then
+ install_server_files.sh
+ install_ut2k4_key.sh
+ elif [ -z "${appid}" ]; then
+ installer=1
+ install_server_files.sh
+ elif [ -n "${appid}" ]; then
+ install_steamcmd.sh
+ install_server_files.sh
+ fi
-# Configuration
-install_config.sh
-if [ "${gamename}" == "BrainBread 2" ]||[ "${gamename}" == "Black Mesa: Deathmatch" ]||[ "${gamename}" == "Counter-Strike: Global Offensive" ]||[ "${gamename}" == "Empires Mod" ]||[ "${gamename}" == "Garry’s Mod" ]||[ "${gamename}" == "No more Room in Hell" ]||[ "${gamename}" == "Team Fortress 2" ]||[ "${gamename}" == "Tower Unite" ]; then
- install_gslt.sh
-elif [ "${gamename}" == "Don't Starve Together" ]; then
- install_dst_token.sh
-elif [ "${gamename}" == "Squad" ]; then
- install_squad_license.sh
-elif [ "${gamename}" == "TeamSpeak 3" ]; then
- install_ts3db.sh
-elif [ "${gamename}" == "Multi Theft Auto" ]; then
- command_install_resources_mta.sh
-fi
+ # Configuration
+ install_config.sh
+ if [ "${gamename}" == "BrainBread 2" ]||[ "${gamename}" == "Black Mesa: Deathmatch" ]||[ "${gamename}" == "Counter-Strike: Global Offensive" ]||[ "${gamename}" == "Empires Mod" ]||[ "${gamename}" == "Garry’s Mod" ]||[ "${gamename}" == "No more Room in Hell" ]||[ "${gamename}" == "Team Fortress 2" ]||[ "${gamename}" == "Tower Unite" ]; then
+ install_gslt.sh
+ elif [ "${gamename}" == "Don't Starve Together" ]; then
+ install_dst_token.sh
+ elif [ "${gamename}" == "Squad" ]; then
+ install_squad_license.sh
+ elif [ "${gamename}" == "TeamSpeak 3" ]; then
+ install_ts3db.sh
+ elif [ "${gamename}" == "Multi Theft Auto" ]; then
+ command_install_resources_mta.sh
+ fi
-fix.sh
-install_complete.sh
-core_exit.sh
+ fix.sh
+ install_complete.sh
+ core_exit.sh
+fi
\ No newline at end of file
diff --git a/lgsm/functions/command_monitor.sh b/lgsm/functions/command_monitor.sh
index 1febd053a..c4b9f9a42 100644
--- a/lgsm/functions/command_monitor.sh
+++ b/lgsm/functions/command_monitor.sh
@@ -26,7 +26,7 @@ for queryattempt in {1..5}; do
fi
"${functionsdir}"/query_gsquery.py -a "${ip}" -p "${queryport}" -e "${engine}" > /dev/null 2>&1
querystatus="$?"
- elif [ "${querymethod}" == "telnet" ]; then
+ elif [ "${querymethod}" == "tcp" ]; then
bash -c 'exec 3<> /dev/tcp/'${ip}'/'${queryport}''
querystatus="$?"
fi
@@ -131,7 +131,7 @@ fn_monitor_check_session(){
fn_monitor_query(){
fn_script_log_info "Querying port: query enabled"
# engines that work with query
- local allowed_engines_array=( avalanche2.0 avalanche3.0 goldsource idtech2 idtech3 idtech3_ql iw2.0 iw3.0 madness quake refractor realvirtuality source spark starbound unity3d unreal unreal2 unreal4 )
+ local allowed_engines_array=( avalanche2.0 avalanche3.0 goldsource idtech2 idtech3 idtech3_ql iw2.0 iw3.0 lwjgl2 madness quake refractor realvirtuality source spark starbound unity3d unreal unreal2 unreal4 wurm )
for allowed_engine in "${allowed_engines_array[@]}"
do
if [ "${allowed_engine}" == "${engine}" ]; then
@@ -143,7 +143,11 @@ fn_monitor_query(){
# will first attempt to use gamedig then gsquery
totalseconds=0
- local query_methods_array=( gamedig gsquery )
+ if [ "${shortname}" == "wurm" ]; then
+ local query_methods_array=( gsquery )
+ else
+ local query_methods_array=( gamedig gsquery )
+ fi
for query_method in "${query_methods_array[@]}"
do
if [ "${query_method}" == "gamedig" ]; then
@@ -165,8 +169,8 @@ fn_monitor_query(){
done
}
-fn_monitor_query_telnet(){
- querymethod="telnet"
+fn_monitor_query_tcp(){
+ querymethod="tcp"
fn_monitor_loop
}
@@ -186,8 +190,8 @@ if [ "${gamename}" == "Starbound" ]; then
if [ "${queryenabled}" == "true" ]; then
fn_monitor_query
fi
-elif [ "${gamename}" == "TeamSpeak 3" ]||[ "${gamename}" == "Eco" ]; then
- fn_monitor_query_telnet
+elif [ "${shortname}" == "ts3" ]||[ "${shortname}" == "eco" ]||[ "${shortname}" == "mumble" ]; then
+ fn_monitor_query_tcp
else
fn_monitor_query
fi
diff --git a/lgsm/functions/command_postdetails.sh b/lgsm/functions/command_postdetails.sh
index 0ef39ce54..1c47f0a64 100644
--- a/lgsm/functions/command_postdetails.sh
+++ b/lgsm/functions/command_postdetails.sh
@@ -51,15 +51,16 @@ fi
if [ -n "${alertflag}" ]; then
postdetailslog="${alertlog}"
else
+ # Run checks and gathers details to display.
+ check.sh
+ info_config.sh
+ info_parms.sh
+ info_distro.sh
+ info_glibc.sh
+ info_messages.sh
+ query_gamedig.sh
touch "${postdetailslog}" || fn_bad_postdetailslog
{
- # Run checks and gathers details to display.
- check.sh
- info_config.sh
- info_distro.sh
- info_glibc.sh
- info_parms.sh
- info_messages.sh
fn_info_message_distro
fn_info_message_performance
fn_info_message_disk
diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh
index 208910942..30c425c51 100644
--- a/lgsm/functions/command_start.sh
+++ b/lgsm/functions/command_start.sh
@@ -58,8 +58,11 @@ fn_start_teamspeak3(){
}
fn_start_tmux(){
- fn_parms
-
+ if [ "${parmsbypass}" ]; then
+ parms=""
+ else
+ fn_parms
+ fi
# check for tmux size variables
if [[ "${servercfgtmuxwidth}" =~ ^[0-9]+$ ]]; then
sessionwidth="${servercfgtmuxwidth}"
@@ -198,7 +201,9 @@ if [ "${status}" != "0" ]; then # $status comes from check_status.sh, which is r
core_exit.sh
fi
fi
-fix.sh
+if [ -z "${fixbypass}" ];then
+ fix.sh
+fi
info_config.sh
logs.sh
diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh
index 1ed3df5c4..72641d2d2 100644
--- a/lgsm/functions/command_stop.sh
+++ b/lgsm/functions/command_stop.sh
@@ -187,7 +187,7 @@ fn_stop_graceful_select(){
fn_stop_graceful_cmd "quit" 120
elif [ "${engine}" == "goldsource" ]; then
fn_stop_graceful_goldsource
- elif [ "${engine}" == "avalanche2.0" ]||[ "${engine}" == "avalanche3.0" ]||[ "${gamename}" == "Factorio" ]||[ "${engine}" == "unity3d" ]||[ "${engine}" == "unreal4" ]||[ "${engine}" == "unreal3" ]||[ "${engine}" == "unreal2" ]||[ "${engine}" == "unreal" ]||[ "${gamename}" == "Mumble" ]; then
+ elif [ "${engine}" == "avalanche2.0" ]||[ "${engine}" == "avalanche3.0" ]||[ "${gamename}" == "Factorio" ]||[ "${engine}" == "unity3d" ]||[ "${engine}" == "unreal4" ]||[ "${engine}" == "unreal3" ]||[ "${engine}" == "unreal2" ]||[ "${engine}" == "unreal" ]||[ "${gamename}" == "Mumble" ]||[ "${shortname}" == "wurm" ]; then
fn_stop_graceful_ctrlc
elif [ "${engine}" == "source" ]||[ "${engine}" == "quake" ]||[ "${engine}" == "idtech2" ]||[ "${engine}" == "idtech3" ]||[ "${engine}" == "idtech3_ql" ]||[ "${engine}" == "Just Cause 2" ]||[ "${engine}" == "projectzomboid" ]||[ "${shortname}" == "rw" ]; then
fn_stop_graceful_cmd "quit" 30
@@ -301,4 +301,6 @@ fn_stop_pre_check
if [ -f "${rootdir}/${lockselfname}" ]; then
rm -f "${rootdir}/${lockselfname}"
fi
-core_exit.sh
+if [ -z "${exitbypass}" ]; then
+ core_exit.sh
+fi
\ No newline at end of file
diff --git a/lgsm/functions/command_update_linuxgsm.sh b/lgsm/functions/command_update_linuxgsm.sh
index 56383f0ce..25b028ef7 100644
--- a/lgsm/functions/command_update_linuxgsm.sh
+++ b/lgsm/functions/command_update_linuxgsm.sh
@@ -12,11 +12,11 @@ fn_print_dots "Updating LinuxGSM"
sleep 0.5
check.sh
fn_script_log_info "Updating LinuxGSM"
-echo -ne "\n"
+echo -en "\n"
if [ -z "${legacymode}" ]; then
# Check and update _default.cfg
- echo -ne " checking config _default.cfg...\c"
+ echo -en " checking config _default.cfg...\c"
config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(${curlpath} -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg"))
if [ "${config_file_diff}" != "" ]; then
fn_print_update_eol_nl
@@ -30,7 +30,7 @@ if [ -z "${legacymode}" ]; then
fn_script_log_info "checking config _default.cfg: OK"
fi
- echo -ne " checking linuxgsm.sh...\c"
+ echo -en " checking linuxgsm.sh...\c"
tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(${curlpath} -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh"))
if [ "${tmp_script_diff}" != "" ]; then
fn_print_update_eol_nl
@@ -42,11 +42,11 @@ if [ -z "${legacymode}" ]; then
fn_script_log_info "checking linuxgsm.sh: OK"
fn_print_ok_eol_nl
fi
- echo -ne " checking ${selfname}...\c"
+ echo -en " checking ${selfname}...\c"
script_diff=$(diff <(sed '\/shortname/d;\/gameservername/d;\/gamename/d;\/githubuser/d;\/githubrepo/d;\/githubbranch/d' "${tmpdir}/linuxgsm.sh") <(sed '\/shortname/d;\/gameservername/d;\/gamename/d;\/githubuser/d;\/githubrepo/d;\/githubbranch/d' "${rootdir}/${selfname}"))
if [ "${script_diff}" != "" ]; then
fn_print_update_eol_nl
- echo -ne " backup ${selfname}...\c"
+ echo -en " backup ${selfname}...\c"
mkdir -p "${backupdir}/script/"
cp "${rootdir}/${selfname}" "${backupdir}/script/${selfname}-$(date +"%m_%d_%Y_%M").bak"
if [ $? -ne 0 ]; then
@@ -56,7 +56,7 @@ if [ -z "${legacymode}" ]; then
fn_print_ok_eol_nl
echo -e " Backup: ${backupdir}/script/${selfname}-$(date +"%m_%d_%Y_%M").bak"
fi
- echo -ne " fetching ${selfname}...\c"
+ echo -en " fetching ${selfname}...\c"
cp "${tmpdir}/linuxgsm.sh" "${rootdir}/${selfname}"
sed -i "s/shortname=\"core\"/shortname=\"${shortname}\"/g" "${rootdir}/${selfname}"
sed -i "s/gameservername=\"core\"/gameservername=\"${gameservername}\"/g" "${rootdir}/${selfname}"
@@ -78,14 +78,14 @@ if [ -n "${functionsdir}" ]; then
cd "${functionsdir}" || exit
for functionfile in *
do
- echo -ne " checking function ${functionfile}...\c"
+ echo -en " checking function ${functionfile}...\c"
github_file_url_dir="lgsm/functions"
get_function_file=$(${curlpath} --fail -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}")
exitcode=$?
function_file_diff=$(diff "${functionsdir}/${functionfile}" <(${curlpath} --fail -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}"))
if [ ${exitcode} -ne 0 ]; then
fn_print_fail_eol_nl
- echo -ne " removing unknown function ${functionfile}...\c"
+ echo -en " removing unknown function ${functionfile}...\c"
fn_script_log_fatal "removing unknown function ${functionfile}"
rm -f "${functionfile}"
if [ $? -ne 0 ]; then
@@ -113,5 +113,5 @@ else
fn_print_ok "Updating functions"
fn_script_log_pass "Updating functions"
fi
-echo -ne "\n"
+echo -en "\n"
core_exit.sh
diff --git a/lgsm/functions/command_validate.sh b/lgsm/functions/command_validate.sh
index 78fd28f38..a93d59d66 100644
--- a/lgsm/functions/command_validate.sh
+++ b/lgsm/functions/command_validate.sh
@@ -25,7 +25,7 @@ fn_validation(){
unbuffer="stdbuf -i0 -o0 -e0"
fi
- if [ "${engine}" == "goldsource" ]; then
+ if [ "${appid}" == "90" ]; then
${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_info_print 70 +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${branch} +app_update "${appid}" ${branch} validate +quit | tee -a "${lgsmlog}"
else
${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" ${branch} validate +quit | tee -a "${lgsmlog}"
diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh
index ea23b8c7e..ad5de35ee 100644
--- a/lgsm/functions/core_dl.sh
+++ b/lgsm/functions/core_dl.sh
@@ -24,7 +24,7 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_dl_md5(){
# Runs MD5 Check if available
if [ "${md5}" != "0" ]&&[ "${md5}" != "nomd5" ]; then
- echo -ne "verifying ${local_filename} with MD5..."
+ echo -en "verifying ${local_filename} with MD5..."
sleep 0.5
local md5sumcmd=$(md5sum "${local_filedir}/${local_filename}"|awk '{print $1;}')
if [ "${md5sumcmd}" != "${md5}" ]; then
@@ -53,7 +53,7 @@ fn_dl_extract(){
local_filename="${2}"
extractdir="${3}"
# extracts archives
- echo -ne "extracting ${local_filename}..."
+ echo -en "extracting ${local_filename}..."
mime=$(file -b --mime-type "${local_filedir}/${local_filename}")
if [ ! -d "${extractdir}" ]; then
mkdir "${extractdir}"
@@ -85,12 +85,12 @@ fn_dl_extract(){
# Trap to remove file download if canceled before completed
fn_fetch_trap(){
echo ""
- echo -ne "downloading ${local_filename}..."
+ echo -en "downloading ${local_filename}..."
fn_print_canceled_eol_nl
fn_script_log_info "Downloading ${local_filename}...CANCELED"
sleep 0.5
rm -f "${local_filedir}/${local_filename}"
- echo -ne "downloading ${local_filename}..."
+ echo -en "downloading ${local_filename}..."
fn_print_removed_eol_nl
fn_script_log_info "Downloading ${local_filename}...REMOVED"
core_exit.sh
@@ -112,14 +112,14 @@ fn_fetch_file(){
fi
# Trap will remove part downloaded files if canceled
trap fn_fetch_trap INT
- # if larger file shows progress bar
- if [ "${local_filename##*.}" == "bz2" ]||[ "${local_filename##*.}" == "gz" ]||[ "${local_filename##*.}" == "zip" ]||[ "${local_filename##*.}" == "jar" ]; then
- echo -ne "downloading ${local_filename}..."
+ # larger files show a progress bar
+ if [ "${local_filename##*.}" == "bz2" ]||[ "${local_filename##*.}" == "gz" ]||[ "${local_filename##*.}" == "zip" ]||[ "${local_filename##*.}" == "jar" ]||[ "${local_filename##*.}" == "xz" ]; then
+ echo -en "downloading ${local_filename}..."
sleep 0.5
- echo -ne "downloading ${local_filename}..."
+ echo -en "downloading ${local_filename}..."
curlcmd=$(${curlpath} --progress-bar --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}")
else
- echo -ne " fetching ${local_filename}...\c"
+ echo -en " fetching ${local_filename}...\c"
curlcmd=$(${curlpath} -s --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}" 2>&1)
fi
local exitcode=$?
diff --git a/lgsm/functions/core_exit.sh b/lgsm/functions/core_exit.sh
index bc6c2331d..91142aaa8 100644
--- a/lgsm/functions/core_exit.sh
+++ b/lgsm/functions/core_exit.sh
@@ -14,6 +14,12 @@ fn_exit_dev_debug(){
fi
}
+# If running dependency check as root will remove any files that belong to root user.
+if [ "$(whoami)" == "root" ]; then
+ find "${lgsmdir}"/ -group root -prune -exec rm -rf {} + > /dev/null 2>&1
+ find "${logdir}"/ -group root -prune -exec rm -rf {} + > /dev/null 2>&1
+fi
+
if [ -n "${exitbypass}" ]; then
unset exitbypass
elif [ -n "${exitcode}" ]&&[ "${exitcode}" != "0" ]; then
diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh
index c43395dd2..f4b27fdd1 100644
--- a/lgsm/functions/core_functions.sh
+++ b/lgsm/functions/core_functions.sh
@@ -367,6 +367,11 @@ functionfile="${FUNCNAME}"
fn_fetch_function
}
+fix_ss3.sh(){
+functionfile="${FUNCNAME}"
+fn_fetch_function
+}
+
fix_ut2k4.sh(){
functionfile="${FUNCNAME}"
fn_fetch_function
@@ -377,6 +382,11 @@ functionfile="${FUNCNAME}"
fn_fetch_function
}
+fix_wurm.sh(){
+functionfile="${FUNCNAME}"
+fn_fetch_function
+}
+
# Info
info_config.sh(){
diff --git a/lgsm/functions/core_messages.sh b/lgsm/functions/core_messages.sh
index cff44d140..075721999 100644
--- a/lgsm/functions/core_messages.sh
+++ b/lgsm/functions/core_messages.sh
@@ -7,26 +7,26 @@
# nl: new line: message is following by a new line
# eol: end of line: message is placed at the end of the current line
-
-if [ "${ansi}" != "off" ]; then
- # echo colors
- default="\e[0m"
- red="\e[31m"
- lightred="\e[91m"
- green="\e[32m"
- lightgreen="\e[92m"
- yellow="\e[33m"
- lightyellow="\e[93m"
- blue="\e[34m"
- lightblue="\e[94m"
- magenta="\e[35m"
- lightmagenta="\e[95m"
- cyan="\e[36m"
- lightcyan="\e[96m"
-
+fn_ansi_loader(){
+ if [ "${ansi}" != "off" ]; then
+ # echo colors
+ default="\e[0m"
+ red="\e[31m"
+ lightred="\e[91m"
+ green="\e[32m"
+ lightgreen="\e[92m"
+ yellow="\e[33m"
+ lightyellow="\e[93m"
+ blue="\e[34m"
+ lightblue="\e[94m"
+ magenta="\e[35m"
+ lightmagenta="\e[95m"
+ cyan="\e[36m"
+ lightcyan="\e[96m"
+ fi
# carriage return & erase to end of line
creeol="\r\033[K"
-fi
+}
# Log display
########################
diff --git a/lgsm/functions/fix.sh b/lgsm/functions/fix.sh
index 49fd5f16f..232459e0a 100644
--- a/lgsm/functions/fix.sh
+++ b/lgsm/functions/fix.sh
@@ -37,7 +37,7 @@ fn_fix_msg_end(){
}
# Fixes that are run on start
-if [ "${function_selfname}" != "command_install.sh" ]; then
+if [ "${function_selfname}" != "command_install.sh" ]&&[ -z "${fixbypass}" ]; then
if [ -n "${appid}" ]; then
fix_steamcmd.sh
fi
@@ -62,13 +62,15 @@ if [ "${function_selfname}" != "command_install.sh" ]; then
fix_ss3.sh
elif [ "${gamename}" == "Multi Theft Auto" ]; then
fix_mta.sh
+ elif [ "${shortname}" == "wurm" ]; then
+ fix_wurm.sh
fi
fi
# Fixes that are run on install only.
if [ "${function_selfname}" == "command_install.sh" ]; then
echo ""
- echo "Applying ${gamename} Server Fixes"
+ echo "Applying Post-Install Fixes"
echo "================================="
sleep 0.5
if [ "${gamename}" == "Killing Floor" ]; then
diff --git a/lgsm/functions/fix_kf.sh b/lgsm/functions/fix_kf.sh
index ad96678ef..dbb0c78c1 100644
--- a/lgsm/functions/fix_kf.sh
+++ b/lgsm/functions/fix_kf.sh
@@ -21,9 +21,13 @@ echo "applying server name fix."
sleep 0.5
echo "forcing server restart..."
sleep 0.5
+exitbypass=1
command_start.sh
sleep 5
+exitbypass=1
command_stop.sh
+exitbypass=1
command_start.sh
sleep 5
+exitbypass=1
command_stop.sh
\ No newline at end of file
diff --git a/lgsm/functions/fix_kf2.sh b/lgsm/functions/fix_kf2.sh
index 02940bf07..3e3e23080 100644
--- a/lgsm/functions/fix_kf2.sh
+++ b/lgsm/functions/fix_kf2.sh
@@ -17,4 +17,5 @@ sleep 1
exitbypass=1
command_start.sh
sleep 10
+exitbypass=1
command_stop.sh
\ No newline at end of file
diff --git a/lgsm/functions/fix_ro.sh b/lgsm/functions/fix_ro.sh
index 0b4f41f15..b96ae582e 100644
--- a/lgsm/functions/fix_ro.sh
+++ b/lgsm/functions/fix_ro.sh
@@ -24,9 +24,13 @@ echo "applying server name fix."
sleep 0.5
echo "forcing server restart..."
sleep 0.5
+exitbypass=1
command_start.sh
sleep 5
+exitbypass=1
command_stop.sh
+exitbypass=1
command_start.sh
sleep 5
+exitbypass=1
command_stop.sh
diff --git a/lgsm/functions/fix_ut3.sh b/lgsm/functions/fix_ut3.sh
index 217140432..fa95052ac 100644
--- a/lgsm/functions/fix_ut3.sh
+++ b/lgsm/functions/fix_ut3.sh
@@ -17,4 +17,5 @@ sleep 1
exitbypass=1
command_start.sh
sleep 10
+exitbypass=1
command_stop.sh
\ No newline at end of file
diff --git a/lgsm/functions/fix_wurm.sh b/lgsm/functions/fix_wurm.sh
new file mode 100644
index 000000000..5c90dc402
--- /dev/null
+++ b/lgsm/functions/fix_wurm.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+# LinuxGSM fix_wurm.sh function
+# Author: Daniel Gibbs
+# Website: https://linuxgsm.com
+# Description: Resolves various issues with ARK: Survival Evolved.
+
+# Copies steamclient.so to correct location
+if [ ! -f "${serverfiles}/nativelibs" ]; then
+ cp -f "${serverfiles}/linux64/steamclient.so" "${serverfiles}/nativelibs"
+fi
+
+# First run requires start with no parms
+# After first run new dirs are created
+if [ ! -d "${serverfiles}/Creative" ]; then
+ parmsbypass=1
+ fixbypass=1
+ exitbypass=1
+ command_start.sh
+ sleep 10
+ exitbypass=1
+ command_stop.sh
+ unset parmsbypass
+fi
\ No newline at end of file
diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh
index cf548f78d..97ba4eb1d 100644
--- a/lgsm/functions/info_config.sh
+++ b/lgsm/functions/info_config.sh
@@ -304,6 +304,9 @@ fn_info_config_minecraft(){
rconport="${zero}"
maxplayers="${zero}"
port="${zero}"
+ queryport="${zero}"
+ queryenabled="${unavailable}"
+ rconport="${zero}"
gamemode="${unavailable}"
gameworld="${unavailable}"
else
@@ -312,6 +315,9 @@ fn_info_config_minecraft(){
rconport=$(grep "rcon.port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
maxplayers=$(grep "max-players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
port=$(grep "server-port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
+ queryport=$(grep "query.port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
+ queryenabled=$(grep "enable-query" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/enable-query//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+ rconport=$(grep "rcon.port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
gamemode=$(grep "gamemode" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
gameworld=$(grep "level-name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/level-name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
@@ -1004,6 +1010,37 @@ fn_info_config_etlegacy(){
fi
}
+fn_info_config_wurmunlimited(){
+ if [ ! -f "${servercfgfullpath}" ]; then
+ port="${zero}"
+ queryport="${zero}"
+ rconpassword="${unavailable}"
+ servername="${unavailable}"
+ serverpassword="${unavailable}"
+ adminpassword="${unavailable}"
+ maxplayers="${zero}"
+ else
+
+ port=$(grep "EXTERNALPORT=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
+ queryport=$(grep "QUERYPORT=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
+ servername=$(grep "SERVERNAME=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/SERVERNAME//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+ serverpassword=$(grep "SERVERPASSWORD=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/SERVERPASSWORD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+ adminpassword=$(grep "ADMINPWD=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/ADMINPWD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+ maxplayers=$(grep "MAXPLAYERS=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
+
+ ip=$(grep "IP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/IP//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+ ipsetinconfig=1
+ ipinconfigvar="IP"
+
+ # Not Set
+ port=${port:-"3724"}
+ queryport=${queryport:-"27017"}
+ servername=${servername:-"NOT SET"}
+ serverpassword=${serverpassword:-"NOT SET"}
+ adminpassword=${adminpassword:-"NOT SET"}
+ maxplayers=${maxplayers:-"0"}
+ fi
+}
fn_info_config_squad(){
if [ ! -f "${servercfgfullpath}" ]; then
@@ -1163,6 +1200,8 @@ elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
fn_info_config_wolfensteinenemyterritory
elif [ "${gamename}" == "ET: Legacy" ]; then
fn_info_config_etlegacy
+elif [ "${gamename}" == "Wurm Unlimited" ]; then
+ fn_info_config_wurmunlimited
elif [ "${gamename}" == "Multi Theft Auto" ]; then
fn_info_config_mta
elif [ "${gamename}" == "Squad" ]; then
diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh
index 71e3aa33c..8716bb9f8 100644
--- a/lgsm/functions/info_distro.sh
+++ b/lgsm/functions/info_distro.sh
@@ -91,18 +91,29 @@ load=$(uptime|awk -F 'load average: ' '{ print $2 }')
## Memory information
+# Issue #2005 - Kernel 3.14+ contains MemAvailable which should be used. All others will be calculated
+
+# get the raw KB values of these fields
+physmemtotalkb=$(grep MemTotal /proc/meminfo | awk '{print $2}')
+physmemfreekb=$(grep ^MemFree /proc/meminfo | awk '{print $2}')
+physmembufferskb=$(grep ^Buffers /proc/meminfo | awk '{print $2}')
+physmemcachedkb=$(grep ^Cached /proc/meminfo | awk '{print $2}')
+physmemreclaimablekb=$(grep ^SReclaimable /proc/meminfo | awk '{print $2}')
+
+# check if MemAvailable Exists
+if grep -q ^MemAvailable /proc/meminfo; then
+ physmemactualfreekb=$(grep ^MemAvailable /proc/meminfo | awk '{print $2}')
+else
+ physmemactualfreekb=$((${physmemfreekb}+${physmembufferskb}+${physmemcachedkb}))
+fi
+
# Available RAM and swap.
-physmemtotalmb=$(($(grep MemTotal /proc/meminfo | awk '{print $2}')/1024))
-physmemtotal=$(numfmt --to=iec --from=iec --suffix=B "$(grep ^MemTotal /proc/meminfo | awk '{print $2}')K")
-physmemfree=$(numfmt --to=iec --from=iec --suffix=B "$(grep ^MemAvailable /proc/meminfo | awk '{print $2}')K")
-physmemused=$(numfmt --to=iec --from=iec --suffix=B "$(($(grep "^MemTotal\:" /proc/meminfo | awk '{print $2}')-$(grep "^MemFree\:" /proc/meminfo | awk '{print $2}')-$(grep "^Buffers\:" /proc/meminfo | awk '{print $2}')-$(grep "^Cached\:" /proc/meminfo | awk '{print $2}')-$(grep "^SReclaimable\:" /proc/meminfo | awk '{print $2}')))K")
-{ # try
- physmemavailable=$(numfmt --to=iec --from=iec --suffix=B "$(grep ^MemAvailable /proc/meminfo | awk '{print $2}')K")
- physmemcached=$(numfmt --to=iec --from=iec --suffix=B "$(($(grep ^Cached /proc/meminfo | awk '{print $2}')+$(grep "^SReclaimable\:" /proc/meminfo | awk '{print $2}')))K")
-} 2>/dev/null || { # fail silently, catch
- physmemavailable="n/a"
- physmemcached="n/a"
-}
+physmemtotalmb=$((${physmemtotalkb}/1024))
+physmemtotal=$(numfmt --to=iec --from=iec --suffix=B "${physmemtotalkb}K")
+physmemfree=$(numfmt --to=iec --from=iec --suffix=B "${physmemactualfreekb}K")
+physmemused=$(numfmt --to=iec --from=iec --suffix=B "$((${physmemtotalkb}-${physmemfreekb}-${physmembufferskb}-${physmemcachedkb}-${physmemreclaimablekb}))K")
+physmemavailable=$(numfmt --to=iec --from=iec --suffix=B "${physmemactualfreekb}K")
+physmemcached=$(numfmt --to=iec --from=iec --suffix=B "$((${physmemcachedkb}+${physmemreclaimablekb}))K")
swaptotal=$(numfmt --to=iec --from=iec --suffix=B "$(grep ^SwapTotal /proc/meminfo | awk '{print $2}')K")
swapfree=$(numfmt --to=iec --from=iec --suffix=B "$(grep ^SwapFree /proc/meminfo | awk '{print $2}')K")
@@ -174,13 +185,15 @@ if [ -z "${extip}" ]; then
fi
# Steam Master Server - checks if detected by master server
-if [ "${ip}" ] && [ "${port}" ]; then
- if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]||[ "${shortname}" == "jc2" ]||[ "${shortname}" == "ql" ]; then
- masterserver=$(${curlpath} -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${ip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l)
- if [ "${steammaster}" == "1" ]; then
- masterserver="true"
- else
- masterserver="false"
+if [ ! "$(command -v jq 2>/dev/null)" ]; then
+ if [ "${ip}" ] && [ "${port}" ]; then
+ if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]||[ "${shortname}" == "jc2" ]||[ "${shortname}" == "ql" ]; then
+ masterserver=$(${curlpath} -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${ip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l)
+ if [ "${steammaster}" == "1" ]; then
+ masterserver="true"
+ else
+ masterserver="false"
+ fi
fi
fi
fi
\ No newline at end of file
diff --git a/lgsm/functions/info_glibc.sh b/lgsm/functions/info_glibc.sh
index 244b401c9..f3597cbf8 100644
--- a/lgsm/functions/info_glibc.sh
+++ b/lgsm/functions/info_glibc.sh
@@ -195,6 +195,9 @@ elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
elif [ "${gamename}" == "ET: Legacy" ]; then
glibcrequired="2.7"
glibcfix="no"
+elif [ "${gamename}" == "Wurm Unlimited" ]; then
+ glibcrequired="2.14"
+ glibcfix="no"
elif [ "${gamename}" == "Multi Theft Auto" ]; then
glibcrequired="2.7"
glibcfix="no"
diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh
index ebe44854d..996559796 100644
--- a/lgsm/functions/info_messages.sh
+++ b/lgsm/functions/info_messages.sh
@@ -24,7 +24,11 @@ fn_info_message_head(){
echo -e "${HOSTNAME}"
echo -e ""
echo -e "Server IP"
- echo -e "${ip}:${port}"
+ if [ "${multiple_ip}" == "1" ]; then
+ echo -e "NOT SET"
+ else
+ echo -e "${ip}:${port}"
+ fi
}
fn_info_message_distro(){
@@ -139,7 +143,11 @@ fn_info_message_gameserver(){
fi
# Server ip
- echo -e "${blue}Server IP:\t${default}${ip}:${port}"
+ if [ "${multiple_ip}" == "1" ]; then
+ echo -e "${blue}Server IP:\t${default}NOT SET"
+ else
+ echo -e "${blue}Server IP:\t${default}${ip}:${port}"
+ fi
# External server ip
if [ -n "${extip}" ]; then
@@ -155,7 +163,7 @@ fn_info_message_gameserver(){
# Query enabled (Starbound)
if [ -n "${queryenabled}" ]; then
- echo -e "${blue}Query enabled:\t${default}${rconpassword}"
+ echo -e "${blue}Query enabled:\t${default}${queryenabled}"
fi
# RCON enabled (Starbound)
@@ -222,6 +230,11 @@ fn_info_message_gameserver(){
echo -e "${blue}Default Map:\t${default}${defaultmap}"
fi
+ # Game type
+ if [ -n "${gametype}" ]; then
+ echo -e "${blue}Game type:\t${default}${gametype}"
+ fi
+
# Game mode
if [ -n "${gamemode}" ]; then
echo -e "${blue}Game mode:\t${default}${gamemode}"
@@ -447,7 +460,7 @@ fn_info_message_ports(){
parmslocation="${red}UNKNOWN${default}"
# engines/games that require editing in the config file
- local ports_edit_array=( "avalanche2.0" "avalanche3.0" "Ballistic Overkill" "dontstarve" "Eco" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "Project Cars" "projectzomboid" "quake" "refractor" "realvirtuality" "renderware" "seriousengine35" "Stationeers" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" )
+ local ports_edit_array=( "avalanche2.0" "avalanche3.0" "Ballistic Overkill" "dontstarve" "Eco" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "Project Cars" "projectzomboid" "quake" "refractor" "realvirtuality" "renderware" "seriousengine35" "Stationeers" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" "wurm" )
for port_edit in "${ports_edit_array[@]}"
do
if [ "${shortname}" == "ut3" ]; then
@@ -462,7 +475,7 @@ fn_info_message_ports(){
local ports_edit_array=( "goldsource" "Factorio" "Hurtworld" "iw3.0" "Rust" "spark" "source" "starbound" "unreal4" "realvirtuality")
for port_edit in "${ports_edit_array[@]}"
do
- if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then
+ if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]||[ "${shortname}" == "${port_edit}" ]; then
parmslocation="${configdirserver}"
fi
done
@@ -690,6 +703,8 @@ fn_info_message_minecraft(){
{
echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
echo -e "> Game\tINBOUND\t${port}\ttcp"
+ echo -e "> Game\tINBOUND\t${queryport}\tudp"
+ echo -e "> Game\tINBOUND\t${rconport}\ttcp"
} | column -s $'\t' -t
}
@@ -1078,6 +1093,16 @@ fn_info_message_etlegacy(){
} | column -s $'\t' -t
}
+fn_info_message_wurmunlimited(){
+ echo -e "netstat -atunp | grep WurmServer"
+ echo -e ""
+ {
+ echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
+ echo -e "> Game\tINBOUND\t${port}\ttcp"
+ echo -e "> Game/Query\tINBOUND\t${queryport}\tudp"
+ } | column -s $'\t' -t
+}
+
fn_info_message_mta(){
echo -e "netstat -atunp | grep mta-server64"
echo -e ""
@@ -1153,6 +1178,8 @@ fn_info_message_select_engine(){
fn_info_message_mumble
elif [ "${gamename}" == "Rust" ]; then
fn_info_message_rust
+ elif [ "${gamename}" == "Wurm Unlimited" ]; then
+ fn_info_message_wurmunlimited
elif [ "${shortname}" == "rw" ]; then
fn_info_message_risingworld
elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
@@ -1235,4 +1262,4 @@ fn_info_message_password_strip(){
fi
fi
-}
\ No newline at end of file
+}
diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh
index 28f8a954d..b09eff8b3 100644
--- a/lgsm/functions/install_config.sh
+++ b/lgsm/functions/install_config.sh
@@ -60,18 +60,25 @@ fn_set_config_vars(){
if [ -f "${servercfgfullpath}" ]; then
random=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 8 | xargs)
servername="LinuxGSM"
- rconpass="admin$random"
+ rconpass="admin${random}"
echo "changing hostname."
fn_script_log_info "changing hostname."
sleep 0.5
+ # prevents var from being overwritten with the servername
if grep -q "SERVERNAME=SERVERNAME" "${lgsmdir}/config-default/config-game/${config}" 2>/dev/null; then
sed -i "s/SERVERNAME=SERVERNAME/SERVERNAME=${servername}/g" "${servercfgfullpath}"
+ elif 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}"
fi
echo "changing rcon/admin password."
fn_script_log_info "changing rcon/admin password."
- sed -i "s/ADMINPASSWORD/${rconpass}/g" "${servercfgfullpath}"
+ if [ "${shortname}" == "squad" ]; then
+ sed -i "s/ADMINPASSWORD/${rconpass}/g" "${servercfgdir}/Rcon.cfg"
+ else
+ sed -i "s/ADMINPASSWORD/${rconpass}/g" "${servercfgfullpath}"
+ fi
sleep 0.5
else
fn_script_log_warn "Config file not found, cannot alter it."
@@ -490,7 +497,7 @@ elif [ "${gamename}" == "Serious Sam 3: BFE" ]; then
fn_set_config_vars
elif [ "${gamename}" == "Squad" ]; then
gamedirname="Squad"
- array_configs+=( Server.cfg )
+ array_configs+=( Server.cfg Rcon.cfg )
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
@@ -584,6 +591,12 @@ elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
+elif [ "${gamename}" == "Wurm Unlimited" ]; then
+ gamedirname="WurmUnlimited"
+ array_configs+=( server.cfg )
+ fn_fetch_default_config
+ fn_default_config_remote
+ fn_set_config_vars
elif [ "${gamename}" == "Zombie Panic! Source" ]; then
gamedirname="ZombiePanicSource"
array_configs+=( server.cfg )
diff --git a/lgsm/functions/install_logs.sh b/lgsm/functions/install_logs.sh
index acd6a6917..bc8184839 100644
--- a/lgsm/functions/install_logs.sh
+++ b/lgsm/functions/install_logs.sh
@@ -15,7 +15,7 @@ if [ "${checklogs}" != "1" ]; then
fi
sleep 0.5
# Create LinuxGSM logs
-echo -ne "installing log dir: ${logdir}..."
+echo -en "installing log dir: ${logdir}..."
mkdir -p "${logdir}"
if [ $? -ne 0 ]; then
fn_print_fail_eol_nl
@@ -24,7 +24,7 @@ else
fn_print_ok_eol_nl
fi
-echo -ne "installing LinuxGSM log dir: ${lgsmlogdir}..."
+echo -en "installing LinuxGSM log dir: ${lgsmlogdir}..."
mkdir -p "${lgsmlogdir}"
if [ $? -ne 0 ]; then
fn_print_fail_eol_nl
@@ -32,7 +32,7 @@ if [ $? -ne 0 ]; then
else
fn_print_ok_eol_nl
fi
-echo -ne "creating LinuxGSM log: ${lgsmlog}..."
+echo -en "creating LinuxGSM log: ${lgsmlog}..."
touch "${lgsmlog}"
if [ $? -ne 0 ]; then
fn_print_fail_eol_nl
@@ -42,7 +42,7 @@ else
fi
# Create Console logs
if [ -n "${consolelogdir}" ]; then
- echo -ne "installing console log dir: ${consolelogdir}..."
+ echo -en "installing console log dir: ${consolelogdir}..."
mkdir -p "${consolelogdir}"
if [ $? -ne 0 ]; then
fn_print_fail_eol_nl
@@ -50,7 +50,7 @@ if [ -n "${consolelogdir}" ]; then
else
fn_print_ok_eol_nl
fi
- echo -ne "creating console log: ${consolelog}..."
+ echo -en "creating console log: ${consolelog}..."
touch "${consolelog}"
if [ $? -ne 0 ]; then
fn_print_fail_eol_nl
@@ -62,7 +62,7 @@ fi
# Create Game logs
if [ -n "${gamelogdir}" ]&&[ ! -d "${gamelogdir}" ]; then
- echo -ne "installing game log dir: ${gamelogdir}..."
+ echo -en "installing game log dir: ${gamelogdir}..."
mkdir -p "${gamelogdir}"
if [ $? -ne 0 ]; then
fn_print_fail_eol_nl
@@ -78,7 +78,7 @@ fi
# log/server is in log/: symlink not created
if [ -n "${gamelogdir}" ]; then
if [ "${gamelogdir:0:${#logdir}}" != "${logdir}" ]; then
- echo -ne "creating symlink to game log dir: ${logdir}/server -> ${gamelogdir}..."
+ echo -en "creating symlink to game log dir: ${logdir}/server -> ${gamelogdir}..."
ln -nfs "${gamelogdir}" "${logdir}/server"
if [ $? -ne 0 ]; then
fn_print_fail_eol_nl
@@ -92,7 +92,7 @@ fi
# If server uses SteamCMD create a symbolic link to the Steam logs
if [ -d "${rootdir}/Steam/logs" ]; then
if [ ! -L "${logdir}/steamcmd" ]; then
- echo -ne "creating symlink to steam log dir: ${logdir}/steamcmd -> ${rootdir}/Steam/logs..."
+ echo -en "creating symlink to steam log dir: ${logdir}/steamcmd -> ${rootdir}/Steam/logs..."
ln -nfs "${rootdir}/Steam/logs" "${logdir}/steamcmd"
if [ $? -ne 0 ]; then
fn_print_fail_eol_nl
diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh
index 31a2ece03..a67045747 100644
--- a/lgsm/functions/install_server_files.sh
+++ b/lgsm/functions/install_server_files.sh
@@ -87,7 +87,7 @@ fn_install_server_files_steamcmd(){
fi
if [ "${counter}" -le "4" ]; then
- if [ "${engine}" == "goldsource" ]; then
+ if [ "${appid}" == "90" ]; then
${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_info_print 70 +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${branch} +quit
local exitcode=$?
else
diff --git a/lgsm/functions/mods_core.sh b/lgsm/functions/mods_core.sh
index c53ad7c96..5fd39970f 100644
--- a/lgsm/functions/mods_core.sh
+++ b/lgsm/functions/mods_core.sh
@@ -37,7 +37,7 @@ fn_mod_install_files(){
fn_mod_lowercase(){
if [ "${modlowercase}" == "LowercaseOn" ]; then
- echo -ne "converting ${modprettyname} files to lowercase..."
+ echo -en "converting ${modprettyname} files to lowercase..."
sleep 0.5
fn_script_log_info "Converting ${modprettyname} files to lowercase"
fileswc=$(find "${extractdir}" -depth | wc -l)
@@ -50,10 +50,10 @@ fn_mod_lowercase(){
local exitcode=$?
((renamedwc++))
fi
- echo -ne "${renamedwc} / ${totalfileswc} / ${fileswc} converting ${modprettyname} files to lowercase..." $'\r'
+ echo -en "${renamedwc} / ${totalfileswc} / ${fileswc} converting ${modprettyname} files to lowercase..." $'\r'
((totalfileswc++))
done < <(find "${extractdir}" -depth)
- echo -ne "${renamedwc} / ${totalfileswc} / ${fileswc} converting ${modprettyname} files to lowercase..."
+ echo -en "${renamedwc} / ${totalfileswc} / ${fileswc} converting ${modprettyname} files to lowercase..."
if [ ${exitcode} -ne 0 ]; then
fn_print_fail_eol_nl
@@ -67,7 +67,7 @@ fn_mod_lowercase(){
# Create ${modcommand}-files.txt containing the full extracted file/directory list
fn_mod_create_filelist(){
- echo -ne "building ${modcommand}-files.txt..."
+ echo -en "building ${modcommand}-files.txt..."
sleep 0.5
# ${modsdir}/${modcommand}-files.txt
find "${extractdir}" -mindepth 1 -printf '%P\n' > "${modsdir}/${modcommand}-files.txt"
@@ -89,7 +89,7 @@ fn_mod_create_filelist(){
# Copy the mod into serverfiles
fn_mod_copy_destination(){
- echo -ne "copying ${modprettyname} to ${modinstalldir}..."
+ echo -en "copying ${modprettyname} to ${modinstalldir}..."
sleep 0.5
cp -Rf "${extractdir}/." "${modinstalldir}/"
local exitcode=$?
@@ -115,7 +115,7 @@ fn_mod_tidy_files_list(){
# Check file list validity
fn_check_mod_files_list
# Output to the user
- echo -ne "tidy up ${modcommand}-files.txt..."
+ echo -en "tidy up ${modcommand}-files.txt..."
sleep 0.5
fn_script_log_info "Tidy up ${modcommand}-files.txt"
# Lines/files to remove from file list (end with ";" separator)
@@ -385,7 +385,7 @@ fn_mods_create_tmp_dir(){
if [ ! -d "${modstmpdir}" ]; then
mkdir -p "${modstmpdir}"
exitcode=$?
- echo -ne "creating mod download directory ${modstmpdir}..."
+ echo -en "creating mod download directory ${modstmpdir}..."
if [ ${exitcode} -ne 0 ]; then
fn_print_fail_eol_nl
fn_script_log_fatal "Creating mod download directory ${modstmpdir}"
@@ -400,7 +400,7 @@ fn_mods_create_tmp_dir(){
# Remove the tmp mod download directory when finished
fn_mods_clear_tmp_dir(){
if [ -d "${modstmpdir}" ]; then
- echo -ne "clearing mod download directory ${modstmpdir}..."
+ echo -en "clearing mod download directory ${modstmpdir}..."
rm -r "${modstmpdir}"
exitcode=$?
if [ ${exitcode} -ne 0 ]; then
diff --git a/lgsm/functions/mods_list.sh b/lgsm/functions/mods_list.sh
index c2c086134..dcc2fbecf 100644
--- a/lgsm/functions/mods_list.sh
+++ b/lgsm/functions/mods_list.sh
@@ -60,6 +60,10 @@ modseparator="MOD"
mod_info_metamod=( MOD "metamod" "MetaMod" "${metamodurl}" "${metamodlatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/metamod/metaplugins.ini;" "source;" "GAMES" "NOTGAMES" "https://www.sourcemm.net" "Plugins Framework" )
mod_info_sourcemod=( MOD "sourcemod" "SourceMod" "${sourcemodurl}" "${sourcemodlatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "source;" "GAMES" "NOTGAMES" "http://www.sourcemod.net" "Admin Features (requires MetaMod)" )
+# CS:GO Mods
+mod_info_gokz=( MOD "gokz" "GOKZ" "https://bitbucket.org/kztimerglobalteam/gokz/downloads/GOKZ-latest.zip" "gokz-latest.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "source;" "Counter Strike: Global Offensive" "NOTGAMES" "https://bitbucket.org/kztimerglobalteam/gokz/src/master/" "Implements the KZ game mode (requires SourceMod and MetaMod)")
+mod_info_ttt=( MOD "ttt" "Trouble in Terrorist Town" "https://csgottt.com/downloads/ttt-latest-dev-${sourcemodmversion}.zip" "ttt-latest.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "source;" "Counter Strike: Global Offensive" "NOTGAMES" "https://github.com/Bara/TroubleinTerroristTown" "Implements the TTT game mode (requires SourceMod and MetaMod)")
+
# Garry's Mod Addons
mod_info_ulib=( MOD "ulib" "ULib" "https://codeload.github.com/TeamUlysses/ulib/zip/master" "ulib-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://ulyssesmod.net" "Complete Framework" )
mod_info_ulx=( MOD "ulx" "ULX" "https://codeload.github.com/TeamUlysses/ulx/zip/master" "ulx-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://ulyssesmod.net" "Admin Panel (requires ULib)" )
@@ -81,4 +85,4 @@ mod_info_hwoxide=( MOD "hwoxide" "Oxide for Hurtworld" "${oxidehurtworldlatestli
mod_info_sdtdoxide=( MOD "sdtdoxide" "Oxide for 7 Days To Die" "${oxidesdtdlatestlink}" "Oxide.SevenDaysToDie.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "7 Days To Die;" "NOTGAMES" "http://oxidemod.org/downloads/oxide-for-7-days-to-die.813/" "Allows for the use of plugins" )
# REQUIRED: Set all mods info into the global array
-mods_global_array=( "${mod_info_metamod[@]}" "${mod_info_sourcemod[@]}" "${mod_info_ulib[@]}" "${mod_info_ulx[@]}" "${mod_info_utime[@]}" "${mod_info_uclip[@]}" "${mod_info_acf[@]}" "${mod_info_acf_missiles[@]}" "${mod_info_acf_sweps[@]}" "${mod_info_advdupe2[@]}" "${mod_info_pac3[@]}" "${mod_info_wiremod[@]}" "${mod_info_wiremodextras[@]}" "${mod_info_darkrp[@]}" "${mod_info_darkrpmodification[@]}" "${mod_info_rustoxide[@]}" "${mod_info_hwoxide[@]}" "${mod_info_sdtdoxide[@]}" )
+mods_global_array=( "${mod_info_metamod[@]}" "${mod_info_sourcemod[@]}" "${mod_info_gokz[@]}" "${mod_info_ttt[@]}" "${mod_info_ulib[@]}" "${mod_info_ulx[@]}" "${mod_info_utime[@]}" "${mod_info_uclip[@]}" "${mod_info_acf[@]}" "${mod_info_acf_missiles[@]}" "${mod_info_acf_sweps[@]}" "${mod_info_advdupe2[@]}" "${mod_info_pac3[@]}" "${mod_info_wiremod[@]}" "${mod_info_wiremodextras[@]}" "${mod_info_darkrp[@]}" "${mod_info_darkrpmodification[@]}" "${mod_info_rustoxide[@]}" "${mod_info_hwoxide[@]}" "${mod_info_sdtdoxide[@]}" )
diff --git a/lgsm/functions/query_gamedig.sh b/lgsm/functions/query_gamedig.sh
index aaba68204..b8cad6159 100644
--- a/lgsm/functions/query_gamedig.sh
+++ b/lgsm/functions/query_gamedig.sh
@@ -14,7 +14,7 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ];
local engine="unreal4"
fi
- local engine_query_array=( avalanche3.0 madness quakelive realvirtuality refractor source goldsource spark starbound unity3d unreal4 )
+ local engine_query_array=( avalanche3.0 madness quakelive realvirtuality refractor source goldsource spark starbound unity3d unreal4 wurm )
for engine_query in "${engine_query_array[@]}"
do
if [ "${engine_query}" == "${engine}" ]; then
@@ -46,6 +46,14 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ];
fi
done
+ local engine_query_array=( lwjgl2 )
+ for engine_query in "${engine_query_array[@]}"
+ do
+ if [ "${engine_query}" == "${engine}" ]; then
+ gamedigengine="minecraft"
+ fi
+ done
+
local shortname_query_array=( ts3 )
for shortname_query in "${shortname_query_array[@]}"
do
diff --git a/lgsm/functions/query_gsquery.py b/lgsm/functions/query_gsquery.py
index d672870b9..3f8ec590b 100644
--- a/lgsm/functions/query_gsquery.py
+++ b/lgsm/functions/query_gsquery.py
@@ -17,21 +17,25 @@ class gsquery:
self.server_response_timeout = 5
self.default_buffer_length = 1024
#
- sourcequery=[ 'avalanche3.0','madness','quakelive','realvirtuality','refractor','source','goldsource','spark','starbound','unity3d', 'unreal4' ]
+ sourcequery=[ 'avalanche3.0','madness','quakelive','realvirtuality','refractor','source','goldsource','spark','starbound','unity3d', 'unreal4', 'wurm' ]
idtech3query=['idtech3','quake','iw3.0']
idtech2query=['idtech2','iw2.0']
+ minecraftquery=['minecraft','lwjgl2']
if self.option.engine in sourcequery:
self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0'
elif self.option.engine in idtech2query:
self.query_prompt_string = b'\xff\xff\xff\xffstatus\x00'
elif self.option.engine in idtech3query:
self.query_prompt_string = b'\xff\xff\xff\xffgetstatus'
+ elif self.option.engine in minecraftquery:
+ self.query_prompt_string = b'\xFE\xFD\x09\x3d\x54\x1f\x93'
elif self.option.engine == 'avalanche2.0':
self.query_prompt_string = b'\xFE\xFD\x09\x10\x20\x30\x40'
elif self.option.engine == 'unreal':
self.query_prompt_string = b'\x5C\x69\x6E\x66\x6F\x5C'
elif self.option.engine == 'unreal2':
self.query_prompt_string = b'\x79\x00\x00\x00\x00'
+
self.connected = False
self.response = None
self.sanity_checks()
@@ -100,7 +104,7 @@ if __name__ == '__main__':
action='store',
dest='engine',
default=False,
- help='Engine type: avalanche2.0, avalanche3.0, goldsource, idtech2, idtech3, iw2.0, iw3.0, realvirtuality, quake, quakelive, refractor, spark, source, unity3d, unreal, unreal2.'
+ help='Engine type: avalanche2.0, avalanche3.0, goldsource, idtech2, idtech3, iw2.0, iw3.0, minecraft, quake, quakelive, realvirtuality, refractor, spark, source, unity3d, unreal, unreal2.'
)
parser.add_option(
'-v', '--verbose',
diff --git a/lgsm/functions/update_factorio.sh b/lgsm/functions/update_factorio.sh
index ca70396e8..887bdd22b 100644
--- a/lgsm/functions/update_factorio.sh
+++ b/lgsm/functions/update_factorio.sh
@@ -10,8 +10,13 @@ local commandaction="Update"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_update_factorio_dl(){
- fn_fetch_file "https://www.factorio.com/get-download/${availablebuild}/headless/${factorioarch}" "${tmpdir}" "factorio_headless_${factorioarch}-${availablebuild}.tar.gz"
- fn_dl_extract "${tmpdir}" "factorio_headless_${factorioarch}-${availablebuild}.tar.gz" "${tmpdir}"
+ if [ "${branch}" == "stable" ]; then
+ downloadbranch="stable"
+ elif [ "${branch}" == "experimental" ]; then
+ downloadbranch="latest"
+ fi
+ fn_fetch_file "https://factorio.com/get-download/${downloadbranch}/headless/${factorioarch}" "${tmpdir}" "factorio_headless_${factorioarch}-${availablebuild}.tar.xz"
+ fn_dl_extract "${tmpdir}" "factorio_headless_${factorioarch}-${availablebuild}.tar.xz" "${tmpdir}"
echo -e "copying to ${serverfiles}...\c"
fn_script_log "Copying to ${serverfiles}"
cp -R "${tmpdir}/factorio/"* "${serverfiles}"
@@ -77,12 +82,10 @@ fn_update_factorio_arch(){
fn_update_factorio_availablebuild(){
# Gets latest build info.
if [ "${branch}" != "stable" ]; then
- availablebuild=$(${curlpath} -s https://www.factorio.com/download-headless/"${branch}" | grep 'headless/linux64' | head -n 2 | tail -n 1 | grep -oP '(?<=get-download/).*?(?=/)')
+ availablebuild=$(${curlpath} -s https://factorio.com/get-download/stable/headless/linux64 | grep -o '[0-9]\.[0-9]\{2\}\.[0-9]\{2\}' | head -1)
else
- availablebuild=$(${curlpath} -s https://www.factorio.com/download-headless | grep 'headless/linux64' | head -n 2 | tail -n 1 | grep -oP '(?<=get-download/).*?(?=/)')
+ availablebuild=$(${curlpath} -s https://factorio.com/get-download/latest/headless/linux64 | grep -o '[0-9]\.[0-9]\{2\}\.[0-9]\{2\}' | head -1)
fi
- sleep 0.5
-
# Checks if availablebuild variable has been set
if [ -z "${availablebuild}" ]; then
fn_print_fail "Checking for update: factorio.com"
@@ -112,7 +115,6 @@ fn_update_factorio_compare(){
echo -e " Available build: ${green}${availablebuild} ${factorioarch} ${branch}${default}"
echo -e ""
sleep 0.5
- echo ""
echo -en "Applying update.\r"
sleep 1
echo -en "Applying update..\r"
diff --git a/lgsm/functions/update_minecraft.sh b/lgsm/functions/update_minecraft.sh
index 947de934a..31c1f0a20 100644
--- a/lgsm/functions/update_minecraft.sh
+++ b/lgsm/functions/update_minecraft.sh
@@ -102,7 +102,6 @@ fn_update_compare(){
echo -e " Available build: ${green}${availablebuild}${default}"
echo -e ""
sleep 0.5
- echo ""
echo -en "Applying update.\r"
sleep 1
echo -en "Applying update..\r"
diff --git a/lgsm/functions/update_mta.sh b/lgsm/functions/update_mta.sh
index 1a4bb4419..85c7b1053 100644
--- a/lgsm/functions/update_mta.sh
+++ b/lgsm/functions/update_mta.sh
@@ -92,11 +92,10 @@ fn_update_mta_compare(){
echo -e "\n"
echo -e "Update ${mta_update_string}:"
sleep 0.5
- echo -e " Current build: ${red}${currentbuild} ${default}"
- echo -e " Available build: ${green}${fullversion} ${default}"
+ echo -e " Current build: ${red}${currentbuild} ${default}"
+ echo -e " Available build: ${green}${fullversion} ${default}"
echo -e ""
sleep 0.5
- echo ""
echo -en "Applying update.\r"
sleep 1
echo -en "Applying update..\r"
diff --git a/lgsm/functions/update_mumble.sh b/lgsm/functions/update_mumble.sh
index 3ad1c1a47..6988fc317 100644
--- a/lgsm/functions/update_mumble.sh
+++ b/lgsm/functions/update_mumble.sh
@@ -108,7 +108,6 @@ fn_update_mumble_compare(){
echo -e " Available build: ${green}${availablebuild} ${mumblearch}${default}"
echo -e ""
sleep 0.5
- echo ""
echo -en "Applying update.\r"
sleep 1
echo -en "Applying update..\r"
diff --git a/lgsm/functions/update_steamcmd.sh b/lgsm/functions/update_steamcmd.sh
index b60adbc53..15fb0277f 100644
--- a/lgsm/functions/update_steamcmd.sh
+++ b/lgsm/functions/update_steamcmd.sh
@@ -26,7 +26,7 @@ fn_update_steamcmd_dl(){
fi
cd "${steamcmddir}" || exit
- if [ "${engine}" == "goldsource" ]; then
+ if [ "${appid}" == "90" ]; then
${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_info_print 70 +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${branch} +quit | tee -a "${lgsmlog}"
else
${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" ${branch} +quit | tee -a "${lgsmlog}"
@@ -111,7 +111,7 @@ fn_update_request_log(){
fn_print_ok_nl "Checking for update: Server logs: Update requested"
fn_script_log_pass "Checking for update: Server logs: Update requested"
sleep 0.5
- echo ""
+ echo -e ""
echo -en "Applying update.\r"
sleep 1
echo -en "Applying update..\r"
@@ -166,7 +166,7 @@ fn_update_steamcmd_check(){
# Gets availablebuild info
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:]')
+ availablebuild=$(./steamcmd.sh +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed '1,/branches/d' | sed "1,/${branchname}/d" | grep -m 1 buildid | tr -cd '[:digit:]')
if [ -z "${availablebuild}" ]; then
fn_print_fail "Checking for update: SteamCMD"
sleep 0.5
diff --git a/lgsm/functions/update_ts3.sh b/lgsm/functions/update_ts3.sh
index 596979348..8471e9952 100644
--- a/lgsm/functions/update_ts3.sh
+++ b/lgsm/functions/update_ts3.sh
@@ -8,7 +8,7 @@ local commandname="UPDATE"
local commandaction="Update"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
-fn_update_ts3_dl(){
+fn_update_ts3_dl_legacy(){
fn_fetch_file "http://dl.4players.de/ts/releases/${ts3_version_number}/teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2" "${tmpdir}" "teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2"
fn_dl_extract "${tmpdir}" "teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2" "${tmpdir}"
echo -e "copying to ${serverfiles}...\c"
@@ -22,6 +22,21 @@ fn_update_ts3_dl(){
fi
}
+fn_update_ts3_dl(){
+ latestmcreleaselink=$(${curlpath} -s 'https://www.teamspeak.com/versions/server.json' | jq -r '.linux.x86_64.mirrors."4Netplayers.de"')
+ fn_fetch_file "${latestmcbuildurl}" "${tmpdir}" "teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2"
+ fn_dl_extract "${tmpdir}" "teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2" "${tmpdir}"
+ echo -e "copying to ${serverfiles}...\c"
+ fn_script_log "Copying to ${serverfiles}"
+ cp -R "${tmpdir}/teamspeak3-server_linux_${ts3arch}/"* "${serverfiles}"
+ local exitcode=$?
+ if [ "${exitcode}" == "0" ]; then
+ fn_print_ok_eol_nl
+ else
+ fn_print_fail_eol_nl
+ fi
+}
+
fn_update_ts3_currentbuild(){
# Gets current build info
# Checks if current build info is available. If it fails, then a server restart will be forced to generate logs.
@@ -152,7 +167,7 @@ fn_update_ts3_compare(){
currentbuilddigit=$(echo "${currentbuild}" | tr -cd '[:digit:]')
availablebuilddigit=$(echo "${availablebuild}" | tr -cd '[:digit:]')
- if [ "${currentbuilddigit}" -ne "${availablebuilddigit}" ]; then
+ if [ "${currentbuilddigit}" -lt "${availablebuilddigit}" ]; then
echo -e "\n"
echo -e "Update available:"
sleep 0.5
@@ -160,7 +175,6 @@ fn_update_ts3_compare(){
echo -e " Available build: ${green}${availablebuild} ${ts3arch}${default}"
echo -e ""
sleep 0.5
- echo ""
echo -en "Applying update.\r"
sleep 1
echo -en "Applying update..\r"
@@ -208,10 +222,11 @@ if [ "${installer}" == "1" ]; then
# if jq available uses json update checker
if [ "$(command -v jq >/dev/null 2>&1)" ]; then
fn_update_ts3_availablebuild
+ fn_update_ts3_dl
else
fn_update_ts3_availablebuild_legacy
+ fn_update_ts3_dl_legacy
fi
- fn_update_ts3_dl
else
# Checks for server update from teamspeak.com using a mirror dl.4players.de.
fn_print_dots "Checking for update: teamspeak.com"
diff --git a/linuxgsm.sh b/linuxgsm.sh
index 7ed07760a..86d61b57e 100755
--- a/linuxgsm.sh
+++ b/linuxgsm.sh
@@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
set -x
fi
-version="180908"
+version="181027"
shortname="core"
gameservername="core"
rootdir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
@@ -38,6 +38,7 @@ tmpdir="${lgsmdir}/tmp"
configdir="${lgsmdir}/config-lgsm"
configdirserver="${configdir}/${gameservername}"
configdirdefault="${lgsmdir}/config-default"
+userinput="${1}"
## GitHub Branch Select
# Allows for the use of different function files
@@ -75,18 +76,18 @@ fn_bootstrap_fetch_file(){
# If curl exists download file
if [ "$(basename "${curlpath}")" == "curl" ]; then
# trap to remove part downloaded files
- echo -ne " fetching ${local_filename}...\c"
+ echo -en " fetching ${local_filename}...\c"
curlcmd=$(${curlpath} -s --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}" 2>&1)
local exitcode=$?
if [ ${exitcode} -ne 0 ]; then
- echo -e "\e[0;31mFAIL\e[0m\n"
+ echo -e "FAIL"
if [ -f "${lgsmlog}" ]; then
echo -e "${remote_fileurl}" | tee -a "${lgsmlog}"
echo "${curlcmd}" | tee -a "${lgsmlog}"
fi
exit 1
else
- echo -e "\e[0;32mOK\e[0m"
+ echo -e "OK"
fi
else
echo "[ FAIL ] Curl is not installed"
@@ -254,9 +255,14 @@ fn_install_file(){
exit
}
-# Prevent from running this script as root.
+# Prevent LinuxGSM from running as root. Except if doing a dependency install.
if [ "$(whoami)" == "root" ]; then
- if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then
+ if [ "${userinput}" == "install" ]||[ "${userinput}" == "auto-install" ]||[ "${userinput}" == "i" ]||[ "${userinput}" == "ai" ]; then
+ if [ "${shortname}" == "core" ]; then
+ echo "[ FAIL ] Do NOT run this script as root!"
+ exit 1
+ fi
+ elif [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then
echo "[ FAIL ] Do NOT run this script as root!"
exit 1
else
@@ -267,7 +273,6 @@ fi
# LinuxGSM installer mode
if [ "${shortname}" == "core" ]; then
- userinput=$1
datadir="${tmpdir}/data"
serverlist="${datadir}/serverlist.csv"
@@ -310,63 +315,66 @@ if [ "${shortname}" == "core" ]; then
# LinuxGSM Server Mode
else
core_functions.sh
-
- # Load LinuxGSM configs
- # These are required to get all the default variables for the specific server.
- # Load the default config. If missing download it. If changed reload it.
- if [ ! -f "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" ]; then
- mkdir -p "${configdirdefault}/config-lgsm/${gameservername}"
- fn_fetch_config "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "_default.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
- fi
- if [ ! -f "${configdirserver}/_default.cfg" ]; then
- mkdir -p "${configdirserver}"
- echo -ne " copying _default.cfg...\c"
- cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
- exitcode=$?
- if [ ${exitcode} -ne 0 ]; then
- echo -e "\e[0;31mFAIL\e[0m\n"
- exit 1
- else
- echo -e "\e[0;32mOK\e[0m"
+ if [ "${shortname}" != "core-dep" ]; then
+ # Load LinuxGSM configs
+ # These are required to get all the default variables for the specific server.
+ # Load the default config. If missing download it. If changed reload it.
+ if [ ! -f "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" ]; then
+ mkdir -p "${configdirdefault}/config-lgsm/${gameservername}"
+ fn_fetch_config "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "_default.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
fi
- else
- 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"
+ if [ ! -f "${configdirserver}/_default.cfg" ]; then
+ mkdir -p "${configdirserver}"
+ echo -en " copying _default.cfg...\c"
cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
exitcode=$?
if [ ${exitcode} -ne 0 ]; then
- echo -e "\e[0;31mFAIL\e[0m\n"
+ echo -e "FAIL"
exit 1
else
- echo -e "\e[0;32mOK\e[0m"
+ echo -e "OK"
+ fi
+ else
+ 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 -en " copying _default.cfg...\c"
+ cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
+ exitcode=$?
+ if [ ${exitcode} -ne 0 ]; then
+ echo -e "FAIL"
+ exit 1
+ else
+ echo -e "OK"
+ fi
fi
fi
- fi
- source "${configdirserver}/_default.cfg"
- # Load the common.cfg config. If missing download it
- if [ ! -f "${configdirserver}/common.cfg" ]; then
- fn_fetch_config "lgsm/config-default/config-lgsm" "common-template.cfg" "${configdirserver}" "common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5"
- source "${configdirserver}/common.cfg"
- else
- source "${configdirserver}/common.cfg"
- fi
- # Load the instance.cfg config. If missing download it
- if [ ! -f "${configdirserver}/${servicename}.cfg" ]; then
- fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${servicename}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
- source "${configdirserver}/${servicename}.cfg"
- else
- source "${configdirserver}/${servicename}.cfg"
- fi
- # Load the linuxgsm.sh in to tmpdir. If missing download it
- if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then
- fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "chmodx" "norun" "noforcedl" "nomd5"
- fi
+ source "${configdirserver}/_default.cfg"
+ # Load the common.cfg config. If missing download it
+ if [ ! -f "${configdirserver}/common.cfg" ]; then
+ fn_fetch_config "lgsm/config-default/config-lgsm" "common-template.cfg" "${configdirserver}" "common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5"
+ source "${configdirserver}/common.cfg"
+ else
+ source "${configdirserver}/common.cfg"
+ fi
+ # Load the instance.cfg config. If missing download it
+ if [ ! -f "${configdirserver}/${servicename}.cfg" ]; then
+ fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${servicename}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
+ source "${configdirserver}/${servicename}.cfg"
+ else
+ source "${configdirserver}/${servicename}.cfg"
+ fi
+ # Load the linuxgsm.sh in to tmpdir. If missing download it
+ if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then
+ fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "chmodx" "norun" "noforcedl" "nomd5"
+ fi
+ fi
+ # Enables ANSI colours from core_messages.sh. Can be disabled with ansi=off
+ fn_ansi_loader
# Prevents running of core_exit.sh for Travis.
if [ "${travistest}" != "1" ]; then
getopt=$1
core_getopt.sh
fi
-fi
+fi
\ No newline at end of file
diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh
index 31d9205d0..8ed381f05 100644
--- a/tests/tests_fctrserver.sh
+++ b/tests/tests_fctrserver.sh
@@ -69,7 +69,7 @@ fn_bootstrap_fetch_file(){
# If curl exists download file
if [ "$(basename "${curlpath}")" == "curl" ]; then
# trap to remove part downloaded files
- echo -ne " fetching ${local_filename}...\c"
+ echo -en " fetching ${local_filename}...\c"
curlcmd=$(${curlpath} -s --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}" 2>&1)
local exitcode=$?
if [ ${exitcode} -ne 0 ]; then
@@ -314,7 +314,7 @@ else
fi
if [ ! -f "${configdirserver}/_default.cfg" ]; then
mkdir -p "${configdirserver}"
- echo -ne " copying _default.cfg...\c"
+ echo -en " copying _default.cfg...\c"
cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
exitcode=$?
if [ ${exitcode} -ne 0 ]; then
@@ -327,7 +327,7 @@ else
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"
+ echo -en " copying _default.cfg...\c"
cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
exitcode=$?
if [ ${exitcode} -ne 0 ]; then
@@ -392,7 +392,7 @@ fn_setstatus(){
while [ "${requiredstatus}" != "${currentstatus}" ]; do
counter=$((counter+1))
fn_currentstatus_tmux
- echo -ne "New status: ${currentstatus}\\r"
+ echo -en "New status: ${currentstatus}\\r"
if [ "${requiredstatus}" == "ONLINE" ]; then
(command_start.sh > /dev/null 2>&1)
@@ -407,7 +407,7 @@ fn_setstatus(){
exit 1
fi
done
- echo -ne "New status: ${currentstatus}\\r"
+ echo -en "New status: ${currentstatus}\\r"
echo -e "\n"
echo "Test starting:"
echo ""
diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh
index ead84d404..4a6c9265a 100644
--- a/tests/tests_jc2server.sh
+++ b/tests/tests_jc2server.sh
@@ -69,7 +69,7 @@ fn_bootstrap_fetch_file(){
# If curl exists download file
if [ "$(basename "${curlpath}")" == "curl" ]; then
# trap to remove part downloaded files
- echo -ne " fetching ${local_filename}...\c"
+ echo -en " fetching ${local_filename}...\c"
curlcmd=$(${curlpath} -s --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}" 2>&1)
local exitcode=$?
if [ ${exitcode} -ne 0 ]; then
@@ -314,7 +314,7 @@ else
fi
if [ ! -f "${configdirserver}/_default.cfg" ]; then
mkdir -p "${configdirserver}"
- echo -ne " copying _default.cfg...\c"
+ echo -en " copying _default.cfg...\c"
cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
exitcode=$?
if [ ${exitcode} -ne 0 ]; then
@@ -327,7 +327,7 @@ else
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"
+ echo -en " copying _default.cfg...\c"
cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
exitcode=$?
if [ ${exitcode} -ne 0 ]; then
@@ -392,7 +392,7 @@ fn_setstatus(){
while [ "${requiredstatus}" != "${currentstatus}" ]; do
counter=$((counter+1))
fn_currentstatus_tmux
- echo -ne "New status: ${currentstatus}\\r"
+ echo -en "New status: ${currentstatus}\\r"
if [ "${requiredstatus}" == "ONLINE" ]; then
(command_start.sh > /dev/null 2>&1)
@@ -407,7 +407,7 @@ fn_setstatus(){
exit 1
fi
done
- echo -ne "New status: ${currentstatus}\\r"
+ echo -en "New status: ${currentstatus}\\r"
echo -e "\n"
echo "Test starting:"
echo ""
diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh
index f8594c134..a2e091e28 100644
--- a/tests/tests_ts3server.sh
+++ b/tests/tests_ts3server.sh
@@ -69,7 +69,7 @@ fn_bootstrap_fetch_file(){
# If curl exists download file
if [ "$(basename "${curlpath}")" == "curl" ]; then
# trap to remove part downloaded files
- echo -ne " fetching ${local_filename}...\c"
+ echo -en " fetching ${local_filename}...\c"
curlcmd=$(${curlpath} -s --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}" 2>&1)
local exitcode=$?
if [ ${exitcode} -ne 0 ]; then
@@ -314,7 +314,7 @@ else
fi
if [ ! -f "${configdirserver}/_default.cfg" ]; then
mkdir -p "${configdirserver}"
- echo -ne " copying _default.cfg...\c"
+ echo -en " copying _default.cfg...\c"
cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
exitcode=$?
if [ ${exitcode} -ne 0 ]; then
@@ -327,7 +327,7 @@ else
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"
+ echo -en " copying _default.cfg...\c"
cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
exitcode=$?
if [ ${exitcode} -ne 0 ]; then
@@ -392,7 +392,7 @@ fn_setstatus(){
while [ "${requiredstatus}" != "${currentstatus}" ]; do
counter=$((counter+1))
fn_currentstatus_ts3
- echo -ne "New status: ${currentstatus}\\r"
+ echo -en "New status: ${currentstatus}\\r"
if [ "${requiredstatus}" == "ONLINE" ]; then
(command_start.sh > /dev/null 2>&1)
@@ -407,7 +407,7 @@ fn_setstatus(){
exit 1
fi
done
- echo -ne "New status: ${currentstatus}\\r"
+ echo -en "New status: ${currentstatus}\\r"
echo -e "\n"
echo "Test starting:"
echo ""