Skip to content

Commit

Permalink
Merge branch 'hotfix/v20.3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
dgibbs64 committed May 21, 2020
2 parents d9b26ff + 498cb67 commit 04440d6
Show file tree
Hide file tree
Showing 22 changed files with 63 additions and 90 deletions.
6 changes: 1 addition & 5 deletions lgsm/functions/check_ip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@ if [ "${travistest}" != "1" ]; then
echo -en "\n"
echo -en "Set ip=\"0.0.0.0\" to one of the following:\n"
fn_script_log_fatal "Multiple IP addresses found."
if [ "${legacymode}" == "1" ]; then
fn_script_log_fatal "Specify the IP you want to bind within the ${selfname} script."
else
fn_script_log_fatal "Specify the IP you want to bind within: ${configdirserver}."
fi
fn_script_log_fatal "Specify the IP you want to bind within: ${configdirserver}."
fi
echo -en "${getip}\n"
echo -en "\n"
Expand Down
12 changes: 2 additions & 10 deletions lgsm/functions/check_steamcmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,10 @@ fn_install_steamcmd(){
fn_check_steamcmd_user(){
# Checks if steamuser is setup.
if [ "${steamuser}" == "username" ]; then
if [ "${legacymode}" == "1" ]; then
fn_print_fail_nl "Steam login not set. Update steamuser in ${selfname}"
else
fn_print_fail_nl "Steam login not set. Update steamuser in ${configdirserver}"
fi
fn_print_fail_nl "Steam login not set. Update steamuser in ${configdirserver}"
echo -e " * Change steamuser=\"username\" to a valid steam login."
if [ -d "${lgsmlogdir}" ]; then
if [ "${legacymode}" == "1" ]; then
fn_script_log_fatal "Steam login not set. Update steamuser in ${selfname}"
else
fn_script_log_fatal "Steam login not set. Update steamuser in ${configdirserver}"
fi
fn_script_log_fatal "Steam login not set. Update steamuser in ${configdirserver}"
fi
core_exit.sh
fi
Expand Down
2 changes: 0 additions & 2 deletions lgsm/functions/command_monitor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,9 @@ fn_monitor_check_queryport(){
fn_script_log_info "Checking port: CHECKING"
if [ -n "${rconenabled}" ]&&[ "${rconenabled}" != "true" ]&&[ ${shortname} == "av" ]; then
fn_print_warn "Checking port: Unable to query as rconport, rcon not enabled: "
fn_print_warn_eol_nl
fn_script_log_warn "Checking port: Unable to query rconport, rcon not enabled: WARN"
else
fn_print_error "Checking port: Unable to query queryport is not set: "
fn_print_error_eol_nl
fn_script_log_error "Checking port: Unable to query as queryport is not set: ERROR"
fi
core_exit.sh
Expand Down
7 changes: 5 additions & 2 deletions lgsm/functions/command_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,12 @@ fn_start_tmux(){
echo -en "\n"
}


check.sh

fn_print_dots "${servername}"
# Is the server already started.
# $status comes from check_status.sh, which is run by check.sh for this command
if [ "${status}" != "0" ]; then
fn_print_dots "${servername}"
fn_print_info_nl "${servername} is already running"
fn_script_log_error "${servername} is already running"
if [ -z "${exitbypass}" ]; then
Expand All @@ -189,8 +188,12 @@ if [ "${updateonstart}" == "yes" ]||[ "${updateonstart}" == "1" ]||[ "${updateon
exitbypass=1
unset updateonstart
command_update.sh
commandname="START"
commandaction="Starting"
fi

fn_print_dots "${servername}"

if [ "${shortname}" == "ts3" ]; then
fn_start_teamspeak3
else
Expand Down
66 changes: 33 additions & 33 deletions lgsm/functions/command_update_linuxgsm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,39 +32,6 @@ else
fn_print_ok_nl "Selecting repo: ${remotereponame}"
fi

# Check _default.cfg.
echo -en "checking ${remotereponame} config _default.cfg...\c"
fn_script_log_info "Checking ${remotereponame} config _default.cfg"
if [ "${remotereponame}" == "GitHub" ]; then
curl -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null
else
curl -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null
fi
if [ $? != "0" ]; then
fn_print_fail_eol_nl
fn_script_log_fatal "Checking ${remotereponame} config _default.cfg"
fn_script_log_fatal "Curl returned error: $?"
core_exit.sh
fi

if [ "${remotereponame}" == "GitHub" ]; then
config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg"))
else
config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg"))
fi

if [ "${config_file_diff}" != "" ]; then
fn_print_update_eol_nl
fn_script_log_update "Checking ${remotereponame} config _default.cfg"
rm -f "${configdirdefault:?}/config-lgsm/${gameservername:?}/_default.cfg"
fn_fetch_file_github "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "nochmodx" "norun" "noforce" "nomd5"
alert="config"
alert.sh
else
fn_print_ok_eol_nl
fn_script_log_pass "Checking ${remotereponame} config _default.cfg"
fi

# Check linuxsm.sh
echo -en "checking ${remotereponame} linuxgsm.sh...\c"
if [ "${remotereponame}" == "GitHub" ]; then
Expand Down Expand Up @@ -144,6 +111,39 @@ else
fn_script_log_info "Checking ${selfname}"
fi

# Check _default.cfg.
echo -en "checking ${remotereponame} config _default.cfg...\c"
fn_script_log_info "Checking ${remotereponame} config _default.cfg"
if [ "${remotereponame}" == "GitHub" ]; then
curl -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null
else
curl -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null
fi
if [ $? != "0" ]; then
fn_print_fail_eol_nl
fn_script_log_fatal "Checking ${remotereponame} config _default.cfg"
fn_script_log_fatal "Curl returned error: $?"
core_exit.sh
fi

if [ "${remotereponame}" == "GitHub" ]; then
config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg"))
else
config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg"))
fi

if [ "${config_file_diff}" != "" ]; then
fn_print_update_eol_nl
fn_script_log_update "Checking ${remotereponame} config _default.cfg"
rm -f "${configdirdefault:?}/config-lgsm/${gameservername:?}/_default.cfg"
fn_fetch_file_github "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "nochmodx" "norun" "noforce" "nomd5"
alert="config"
alert.sh
else
fn_print_ok_eol_nl
fn_script_log_pass "Checking ${remotereponame} config _default.cfg"
fi

# Check and update modules.
if [ -n "${functionsdir}" ]; then
if [ -d "${functionsdir}" ]; then
Expand Down
6 changes: 5 additions & 1 deletion lgsm/functions/core_dl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,11 @@ fn_fetch_file(){
fn_fetch_file_github(){
github_file_url_dir="${1}"
github_file_url_name="${2}"
if [ "${githubbranch}" == "master" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then
if [ "${legacymode}" == "1" ]; then
# For legacy versions - code can be removed at a future date
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
elif [ "${githubbranch}" == "master" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}"
else
Expand Down
2 changes: 1 addition & 1 deletion lgsm/functions/core_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"

modulesversion="v20.3.0"
modulesversion="v20.3.1"

# Core

Expand Down
10 changes: 9 additions & 1 deletion lgsm/functions/core_legacy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,16 @@

functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"

# This is to help the transition to v20.3.0 and above
legacy_versions_array=( v20.2.1 v20.2.0 v20.1.5 v20.1.4 v20.1.3 v20.1.2 v20.1.1 v20.1.0 v19.12.5 v19.12.4 v19.12.3 v19.12.2 v19.12.1 v19.12.0 )
for legacy_version in "${legacy_versions_array[@]}"
do
if [ "${version}" == "${legacy_version}" ]; then
legacymode=1
fi
done

if [ -z "${serverfiles}" ]; then
legacymode=1
serverfiles="${filesdir}"
fi

Expand Down
2 changes: 1 addition & 1 deletion lgsm/functions/info_distro.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"

### Game Server pid
if [ "${status}" == "1" ]; then
gameserverpid=$(tmux list-sessions -F "#{session_name} #{pane_pid}"| grep "^${sessionname}"|awk '{print $2}')
gameserverpid=$(tmux list-sessions -F "#{session_name} #{pane_pid}" | grep "^${sessionname} " | awk '{print $2}')
fi
### Distro information

Expand Down
2 changes: 1 addition & 1 deletion lgsm/functions/mods_core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ modsinstalledlistfullpath="${modsdir}/${modsinstalledlist}"

# Download management.
fn_mod_install_files(){
fn_fetch_file "${modurl}" "${modstmpdir}" "${modfilename}"
fn_fetch_file "${modurl}" "" "" "" "${modstmpdir}" "${modfilename}"
# Check if variable is valid checking if file has been downloaded and exists.
if [ ! -f "${modstmpdir}/${modfilename}" ]; then
fn_print_failure "An issue occurred downloading ${modprettyname}"
Expand Down
4 changes: 0 additions & 4 deletions lgsm/functions/update_factorio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,3 @@ else
fn_update_factorio_remotebuild
fn_update_factorio_compare
fi

if [ "${commandname}" != "INSTALL" ]; then
core_exit.sh
fi
4 changes: 0 additions & 4 deletions lgsm/functions/update_minecraft.sh
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,3 @@ else
fn_update_minecraft_remotebuild
fn_update_minecraft_compare
fi

if [ "${commandname}" != "INSTALL" ]; then
core_exit.sh
fi
4 changes: 0 additions & 4 deletions lgsm/functions/update_minecraft_bedrock.sh
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,3 @@ else
fn_update_minecraft_remotebuild
fn_update_minecraft_compare
fi

if [ "${commandname}" != "INSTALL" ]; then
core_exit.sh
fi
4 changes: 0 additions & 4 deletions lgsm/functions/update_mta.sh
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,3 @@ else
fn_update_mta_remotebuild
fn_update_mta_compare
fi

if [ "${commandname}" != "INSTALL" ]; then
core_exit.sh
fi
4 changes: 0 additions & 4 deletions lgsm/functions/update_mumble.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,3 @@ else
fn_update_mumble_remotebuild
fn_update_mumble_compare
fi

if [ "${commandname}" != "INSTALL" ]; then
core_exit.sh
fi
4 changes: 0 additions & 4 deletions lgsm/functions/update_steamcmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,3 @@ else
fn_update_steamcmd_remotebuild
fn_update_steamcmd_compare
fi

if [ "${commandname}" != "INSTALL" ]; then
core_exit.sh
fi
4 changes: 0 additions & 4 deletions lgsm/functions/update_ts3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,3 @@ else
fn_update_ts3_remotebuild
fn_update_ts3_compare
fi

if [ "${commandname}" != "INSTALL" ]; then
core_exit.sh
fi
2 changes: 1 addition & 1 deletion linuxgsm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
set -x
fi

version="v20.3.0"
version="v20.3.1"
shortname="core"
gameservername="core"
commandname="CORE"
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_fctrserver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
set -x
fi

version="v20.3.0"
version="v20.3.1"
shortname="fctr"
gameservername="fctrserver"
commandname="CORE"
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_jc2server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
set -x
fi

version="v20.3.0"
version="v20.3.1"
shortname="jc2"
gameservername="jc2server"
commandname="CORE"
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_mcserver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
set -x
fi

version="v20.3.0"
version="v20.3.1"
shortname="mc"
gameservername="mcserver"
commandname="CORE"
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_ts3server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
set -x
fi

version="v20.3.0"
version="v20.3.1"
shortname="ts3"
gameservername="ts3server"
commandname="CORE"
Expand Down

0 comments on commit 04440d6

Please sign in to comment.