Skip to content

Commit 04440d6

Browse files
committed
Merge branch 'hotfix/v20.3.1'
2 parents d9b26ff + 498cb67 commit 04440d6

22 files changed

+63
-90
lines changed

lgsm/functions/check_ip.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,7 @@ if [ "${travistest}" != "1" ]; then
4444
echo -en "\n"
4545
echo -en "Set ip=\"0.0.0.0\" to one of the following:\n"
4646
fn_script_log_fatal "Multiple IP addresses found."
47-
if [ "${legacymode}" == "1" ]; then
48-
fn_script_log_fatal "Specify the IP you want to bind within the ${selfname} script."
49-
else
50-
fn_script_log_fatal "Specify the IP you want to bind within: ${configdirserver}."
51-
fi
47+
fn_script_log_fatal "Specify the IP you want to bind within: ${configdirserver}."
5248
fi
5349
echo -en "${getip}\n"
5450
echo -en "\n"

lgsm/functions/check_steamcmd.sh

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,10 @@ fn_install_steamcmd(){
3131
fn_check_steamcmd_user(){
3232
# Checks if steamuser is setup.
3333
if [ "${steamuser}" == "username" ]; then
34-
if [ "${legacymode}" == "1" ]; then
35-
fn_print_fail_nl "Steam login not set. Update steamuser in ${selfname}"
36-
else
37-
fn_print_fail_nl "Steam login not set. Update steamuser in ${configdirserver}"
38-
fi
34+
fn_print_fail_nl "Steam login not set. Update steamuser in ${configdirserver}"
3935
echo -e " * Change steamuser=\"username\" to a valid steam login."
4036
if [ -d "${lgsmlogdir}" ]; then
41-
if [ "${legacymode}" == "1" ]; then
42-
fn_script_log_fatal "Steam login not set. Update steamuser in ${selfname}"
43-
else
44-
fn_script_log_fatal "Steam login not set. Update steamuser in ${configdirserver}"
45-
fi
37+
fn_script_log_fatal "Steam login not set. Update steamuser in ${configdirserver}"
4638
fi
4739
core_exit.sh
4840
fi

lgsm/functions/command_monitor.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,9 @@ fn_monitor_check_queryport(){
7171
fn_script_log_info "Checking port: CHECKING"
7272
if [ -n "${rconenabled}" ]&&[ "${rconenabled}" != "true" ]&&[ ${shortname} == "av" ]; then
7373
fn_print_warn "Checking port: Unable to query as rconport, rcon not enabled: "
74-
fn_print_warn_eol_nl
7574
fn_script_log_warn "Checking port: Unable to query rconport, rcon not enabled: WARN"
7675
else
7776
fn_print_error "Checking port: Unable to query queryport is not set: "
78-
fn_print_error_eol_nl
7977
fn_script_log_error "Checking port: Unable to query as queryport is not set: ERROR"
8078
fi
8179
core_exit.sh

lgsm/functions/command_start.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,12 @@ fn_start_tmux(){
165165
echo -en "\n"
166166
}
167167

168-
169168
check.sh
170169

171-
fn_print_dots "${servername}"
172170
# Is the server already started.
173171
# $status comes from check_status.sh, which is run by check.sh for this command
174172
if [ "${status}" != "0" ]; then
173+
fn_print_dots "${servername}"
175174
fn_print_info_nl "${servername} is already running"
176175
fn_script_log_error "${servername} is already running"
177176
if [ -z "${exitbypass}" ]; then
@@ -189,8 +188,12 @@ if [ "${updateonstart}" == "yes" ]||[ "${updateonstart}" == "1" ]||[ "${updateon
189188
exitbypass=1
190189
unset updateonstart
191190
command_update.sh
191+
commandname="START"
192+
commandaction="Starting"
192193
fi
193194

195+
fn_print_dots "${servername}"
196+
194197
if [ "${shortname}" == "ts3" ]; then
195198
fn_start_teamspeak3
196199
else

lgsm/functions/command_update_linuxgsm.sh

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -32,39 +32,6 @@ else
3232
fn_print_ok_nl "Selecting repo: ${remotereponame}"
3333
fi
3434

35-
# Check _default.cfg.
36-
echo -en "checking ${remotereponame} config _default.cfg...\c"
37-
fn_script_log_info "Checking ${remotereponame} config _default.cfg"
38-
if [ "${remotereponame}" == "GitHub" ]; then
39-
curl -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null
40-
else
41-
curl -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null
42-
fi
43-
if [ $? != "0" ]; then
44-
fn_print_fail_eol_nl
45-
fn_script_log_fatal "Checking ${remotereponame} config _default.cfg"
46-
fn_script_log_fatal "Curl returned error: $?"
47-
core_exit.sh
48-
fi
49-
50-
if [ "${remotereponame}" == "GitHub" ]; then
51-
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"))
52-
else
53-
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"))
54-
fi
55-
56-
if [ "${config_file_diff}" != "" ]; then
57-
fn_print_update_eol_nl
58-
fn_script_log_update "Checking ${remotereponame} config _default.cfg"
59-
rm -f "${configdirdefault:?}/config-lgsm/${gameservername:?}/_default.cfg"
60-
fn_fetch_file_github "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "nochmodx" "norun" "noforce" "nomd5"
61-
alert="config"
62-
alert.sh
63-
else
64-
fn_print_ok_eol_nl
65-
fn_script_log_pass "Checking ${remotereponame} config _default.cfg"
66-
fi
67-
6835
# Check linuxsm.sh
6936
echo -en "checking ${remotereponame} linuxgsm.sh...\c"
7037
if [ "${remotereponame}" == "GitHub" ]; then
@@ -144,6 +111,39 @@ else
144111
fn_script_log_info "Checking ${selfname}"
145112
fi
146113

114+
# Check _default.cfg.
115+
echo -en "checking ${remotereponame} config _default.cfg...\c"
116+
fn_script_log_info "Checking ${remotereponame} config _default.cfg"
117+
if [ "${remotereponame}" == "GitHub" ]; then
118+
curl -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null
119+
else
120+
curl -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null
121+
fi
122+
if [ $? != "0" ]; then
123+
fn_print_fail_eol_nl
124+
fn_script_log_fatal "Checking ${remotereponame} config _default.cfg"
125+
fn_script_log_fatal "Curl returned error: $?"
126+
core_exit.sh
127+
fi
128+
129+
if [ "${remotereponame}" == "GitHub" ]; then
130+
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"))
131+
else
132+
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"))
133+
fi
134+
135+
if [ "${config_file_diff}" != "" ]; then
136+
fn_print_update_eol_nl
137+
fn_script_log_update "Checking ${remotereponame} config _default.cfg"
138+
rm -f "${configdirdefault:?}/config-lgsm/${gameservername:?}/_default.cfg"
139+
fn_fetch_file_github "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "nochmodx" "norun" "noforce" "nomd5"
140+
alert="config"
141+
alert.sh
142+
else
143+
fn_print_ok_eol_nl
144+
fn_script_log_pass "Checking ${remotereponame} config _default.cfg"
145+
fi
146+
147147
# Check and update modules.
148148
if [ -n "${functionsdir}" ]; then
149149
if [ -d "${functionsdir}" ]; then

lgsm/functions/core_dl.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,11 @@ fn_fetch_file(){
236236
fn_fetch_file_github(){
237237
github_file_url_dir="${1}"
238238
github_file_url_name="${2}"
239-
if [ "${githubbranch}" == "master" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then
239+
if [ "${legacymode}" == "1" ]; then
240+
# For legacy versions - code can be removed at a future date
241+
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
242+
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
243+
elif [ "${githubbranch}" == "master" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then
240244
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}"
241245
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}"
242246
else

lgsm/functions/core_functions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

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

10-
modulesversion="v20.3.0"
10+
modulesversion="v20.3.1"
1111

1212
# Core
1313

lgsm/functions/core_legacy.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,16 @@
66

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

9+
# This is to help the transition to v20.3.0 and above
10+
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 )
11+
for legacy_version in "${legacy_versions_array[@]}"
12+
do
13+
if [ "${version}" == "${legacy_version}" ]; then
14+
legacymode=1
15+
fi
16+
done
17+
918
if [ -z "${serverfiles}" ]; then
10-
legacymode=1
1119
serverfiles="${filesdir}"
1220
fi
1321

lgsm/functions/info_distro.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
99

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

lgsm/functions/mods_core.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ modsinstalledlistfullpath="${modsdir}/${modsinstalledlist}"
1818

1919
# Download management.
2020
fn_mod_install_files(){
21-
fn_fetch_file "${modurl}" "${modstmpdir}" "${modfilename}"
21+
fn_fetch_file "${modurl}" "" "" "" "${modstmpdir}" "${modfilename}"
2222
# Check if variable is valid checking if file has been downloaded and exists.
2323
if [ ! -f "${modstmpdir}/${modfilename}" ]; then
2424
fn_print_failure "An issue occurred downloading ${modprettyname}"

0 commit comments

Comments
 (0)