Skip to content

Commit abfe5c1

Browse files
authored
fix(st): resolve Stationeers config issues (#4733)
* feat(st): add config install * update start parameters * bug * ui fix * rename worldname to worldsave * add worldname to legacy vars
1 parent 9495437 commit abfe5c1

File tree

6 files changed

+45
-34
lines changed

6 files changed

+45
-34
lines changed

lgsm/config-default/config-lgsm/stserver/_default.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
#### Game Server Settings ####
1010

1111
## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters
12-
worldname="moon_save"
12+
worldsave="moon_save"
1313
worldtype="Moon"
1414

1515
## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
16-
startparameters="-LOADLATEST ${worldname} ${worldtype}"
16+
startparameters="-LOAD ${worldsave} ${worldtype}"
1717

1818
#### LinuxGSM Settings ####
1919

lgsm/modules/command_dev_query_raw.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ fn_messages_separator
198198
echo -e ""
199199
echo -e "${bold}${lightyellow}SS Output${default}"
200200
fn_messages_separator
201-
fn_info_message_ports
201+
fn_info_messages_ports
202202
eval "${portcommand}"
203203

204204
echo -e ""

lgsm/modules/command_monitor.sh

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ fn_monitor_check_monitoring() {
1818
date '+%s' > "${lockdir:?}/${selfname}-monitoring.lock"
1919
elif [ ! -f "${lockdir}/${selfname}-monitoring.lock" ]; then
2020
# Monitor does not run if lockfile is not found.
21-
fn_print_dots "Checking lockfile:"
21+
fn_print_dots "Checking lockfile"
2222
fn_print_checking_eol
2323
fn_script_log_info "Checking lockfile: CHECKING"
24-
fn_print_error "Checking lockfile: No lockfile found:"
24+
fn_print_error "Checking lockfile: No lockfile found"
2525
fn_print_error_eol_nl
2626
fn_script_log_error "Checking lockfile: No lockfile found: ERROR"
2727
echo -e "* Start ${selfname} to run monitor."
@@ -31,10 +31,10 @@ fn_monitor_check_monitoring() {
3131

3232
fn_monitor_check_install() {
3333
if [ "$(pgrep -fc -u "${USER}" "/bin/bash ./${selfname} install")" != "0" ] || [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} i")" != "0" ] || [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} auto-install")" != "0" ] || [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} ai")" != "0" ]; then
34-
fn_print_dots "Checking installer:"
34+
fn_print_dots "Checking installer"
3535
fn_print_checking_eol
3636
fn_script_log_info "Checking installer: CHECKING"
37-
fn_print_info "Checking installer: LinuxGSM is installing:"
37+
fn_print_info "Checking installer: LinuxGSM is installing"
3838
fn_print_info_eol_nl
3939
fn_script_log_pass "Checking installer: LinuxGSM is installing"
4040
core_exit.sh
@@ -43,9 +43,9 @@ fn_monitor_check_install() {
4343

4444
fn_monitor_check_debug() {
4545
if [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} debug")" != "0" ] || [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} d")" != "0" ]; then
46-
fn_print_dots "Checking debug:"
46+
fn_print_dots "Checking debug"
4747
fn_print_checking_eol
48-
fn_print_info "Checking debug: Debug is running:"
48+
fn_print_info "Checking debug: Debug is running"
4949
fn_print_info_eol_nl
5050
fn_script_log_pass "Checking debug: Debug is running"
5151
core_exit.sh
@@ -54,9 +54,9 @@ fn_monitor_check_debug() {
5454

5555
fn_monitor_check_details() {
5656
if [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} details")" != "0" ] || [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} dt")" != "0" ]; then
57-
fn_print_dots "Checking details:"
57+
fn_print_dots "Checking details"
5858
fn_print_checking_eol
59-
fn_print_info "Checking details: Details is running:"
59+
fn_print_info "Checking details: Details is running"
6060
fn_print_info_eol_nl
6161
fn_script_log_pass "Checking details: Details is running"
6262
core_exit.sh
@@ -67,19 +67,19 @@ fn_monitor_check_starting() {
6767
# Remove stale lockfile.
6868
if [ -f "${lockdir}/${selfname}-starting.lock" ]; then
6969
if [ "$(find "${lockdir}/${selfname}-starting.lock" -mmin +5)" ]; then
70-
fn_print_dots "Checking start:"
70+
fn_print_dots "Checking start"
7171
fn_print_checking_eol
72-
fn_print_warn "Checking start: Removing stale lockfile:"
72+
fn_print_warn "Checking start: Removing stale lockfile"
7373
fn_print_warn_eol_nl
7474
fn_script_log_warn "Checking start: Removing stale lockfile"
7575
rm -f "${lockdir:?}/${selfname}-starting.lock"
7676
fi
7777
fi
7878

7979
if [ -f "${lockdir}/${selfname}-starting.lock" ] && [[ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} start")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} s")" != "0" ]]; then
80-
fn_print_dots "Checking start:"
80+
fn_print_dots "Checking start"
8181
fn_print_checking_eol
82-
fn_print_info "Checking start: LinuxGSM is starting:"
82+
fn_print_info "Checking start: LinuxGSM is starting"
8383
fn_print_info_eol_nl
8484
fn_script_log_info "Checking backup: LinuxGSM is starting"
8585
core_exit.sh
@@ -90,19 +90,19 @@ fn_monitor_check_stopping() {
9090
# Remove stale lockfile.
9191
if [ -f "${lockdir}/${selfname}-stopping.lock" ]; then
9292
if [ "$(find "${lockdir}/${selfname}-stopping.lock" -mmin +5)" ]; then
93-
fn_print_dots "Checking stop:"
93+
fn_print_dots "Checking stop"
9494
fn_print_checking_eol
95-
fn_print_warn "Checking stop: Removing stale lockfile:"
95+
fn_print_warn "Checking stop: Removing stale lockfile"
9696
fn_print_warn_eol_nl
9797
fn_script_log_warn "Checking stop: Removing stale lockfile"
9898
rm -f "${lockdir:?}/${selfname}-stopping.lock"
9999
fi
100100
fi
101101

102102
if [ -f "${lockdir}/${selfname}-stopping.lock" ] && [[ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} stop")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} s")" != "0" ]]; then
103-
fn_print_dots "Checking stop:"
103+
fn_print_dots "Checking stop"
104104
fn_print_checking_eol
105-
fn_print_info "Checking stop: LinuxGSM is stopping:"
105+
fn_print_info "Checking stop: LinuxGSM is stopping"
106106
fn_print_info_eol_nl
107107
fn_script_log_info "Checking backup: LinuxGSM is stopping"
108108
core_exit.sh
@@ -113,19 +113,19 @@ fn_monitor_check_backup() {
113113
# Remove stale lockfile.
114114
if [ -f "${lockdir}/backup.lock" ]; then
115115
if [ "$(find "${lockdir}/backup.lock" -mmin +60)" ]; then
116-
fn_print_dots "Checking backup:"
116+
fn_print_dots "Checking backup"
117117
fn_print_checking_eol
118-
fn_print_warn "Checking backup: Removing stale lockfile:"
118+
fn_print_warn "Checking backup: Removing stale lockfile"
119119
fn_print_warn_eol
120120
fn_script_log_warn "Checking backup: Removing stale lockfile"
121121
rm -f "${lockdir:?}/backup.lock"
122122
fi
123123
fi
124124

125125
if [ -f "${lockdir}/backup.lock" ] && [[ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} backup")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} b")" != "0" ]]; then
126-
fn_print_dots "Checking backup:"
126+
fn_print_dots "Checking backup"
127127
fn_print_checking_eol
128-
fn_print_info "Checking backup: Backup is running:"
128+
fn_print_info "Checking backup: Backup is running"
129129
fn_print_info_eol_nl
130130
fn_script_log_info "Checking backup: Backup is running"
131131
core_exit.sh
@@ -136,19 +136,19 @@ fn_monitor_check_update() {
136136
# Remove stale lockfile.
137137
if [ -f "${lockdir}/update.lock" ]; then
138138
if [ "$(find "${lockdir}/update.lock" -mmin +15)" ]; then
139-
fn_print_dots "Checking update:"
139+
fn_print_dots "Checking update"
140140
fn_print_checking_eol
141-
fn_print_warn "Checking update: Removing stale lockfile:"
141+
fn_print_warn "Checking update: Removing stale lockfile"
142142
fn_print_warn_eol_nl
143143
fn_script_log_warn "Checking update: Removing stale lockfile"
144144
rm -f "${lockdir:?}/update.lock"
145145
fi
146146
fi
147147

148148
if [ -f "${lockdir}/update.lock" ] && [[ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} update")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} validate")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} v")" != "0" || "$(pgrep -fc force-update "${USER}" "/bin/bash ./${selfname} fu")" != "0" ]]; then
149-
fn_print_dots "Checking update:"
149+
fn_print_dots "Checking update"
150150
fn_print_checking_eol
151-
fn_print_info "Checking update: LinuxGSM is updating the game server:"
151+
fn_print_info "Checking update: LinuxGSM is updating the game server"
152152
fn_print_info_eol_nl
153153
fn_script_log_pass "Checking update: LinuxGSM is updating the game server"
154154
core_exit.sh
@@ -159,10 +159,10 @@ fn_monitor_check_update() {
159159
fn_monitor_check_update_source() {
160160
if [ -f "${consolelogdir}/${selfname}-console.log" ] && [ "${engine}" == "source" ]; then
161161
if grep -q "Your server needs to be restarted in order to receive the latest update." "${consolelogdir}/${selfname}-console.log"; then
162-
fn_print_dots "Checking update:"
162+
fn_print_dots "Checking update"
163163
fn_print_checking_eol
164164
fn_script_log_info "Checking update: CHECKING"
165-
fn_print_ok "Checking update:"
165+
fn_print_ok "Checking update"
166166
fn_print_ok_eol_nl
167167
fn_script_log_info "Checking update: ${selfname} has requested an update and needs to be restarted"
168168
alert="update-request"
@@ -182,7 +182,7 @@ fn_monitor_check_session() {
182182
sessionheight="23"
183183
# Check for PIDS with identical tmux sessions running.
184184
if [ "$(pgrep -fcx "tmux -L ${socketname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}")" -ge "2" ]; then
185-
fn_print_error "Checking session: There are PIDS with identical tmux sessions running:"
185+
fn_print_error "Checking session: There are PIDS with identical tmux sessions running"
186186
fn_print_error_eol_nl
187187
fn_script_log_error "Checking session: ERROR"
188188
fn_script_log_error "Checking session: There are PIDS with identical tmux sessions running"
@@ -192,7 +192,7 @@ fn_monitor_check_session() {
192192
core_exit.sh
193193
# Check for tmux pids with the same tmux session and socket names. This will reduce issues with migration to release v23.5.0. #4296
194194
elif [ "$(pgrep -fc -u "${USER}" "tmux -L ${sessionname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}")" != "0" ]; then
195-
fn_print_error "Checking session: PIDS with the same tmux session and socket names are running:"
195+
fn_print_error "Checking session: PIDS with the same tmux session and socket names are running"
196196
fn_print_error_eol_nl
197197
fn_script_log_error "Checking session: ERROR"
198198
fn_script_log_error "Checking session: PIDS with the same tmux session and socket names are running"
@@ -202,7 +202,7 @@ fn_monitor_check_session() {
202202
core_exit.sh
203203
# Check for tmux pids that are using the old type of tmux session. This will reduce issues with migration to release v23.5.0. #4296
204204
elif [ "$(pgrep -fc -u "${USER}" "tmux new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}")" != "0" ]; then
205-
fn_print_error "Checking session: PIDS with old type tmux session are running:"
205+
fn_print_error "Checking session: PIDS with old type tmux session are running"
206206
fn_print_error_eol_nl
207207
fn_script_log_error "Checking session: ERROR"
208208
fn_script_log_error "Checking session: PIDS with old type tmux session are running"
@@ -233,7 +233,7 @@ fn_monitor_check_session() {
233233
# Monitor will check queryport is set before continuing.
234234
fn_monitor_check_queryport() {
235235
if [ -z "${queryport}" ] || [ "${queryport}" == "0" ]; then
236-
fn_print_dots "Checking port:"
236+
fn_print_dots "Checking port"
237237
fn_print_checking_eol
238238
fn_script_log_info "Checking port: CHECKING"
239239
if [ -n "${rconenabled}" ] && [ "${rconenabled}" != "true" ] && [ "${shortname}" == "av" ]; then

lgsm/modules/core_legacy.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ if [ -n "${autosaveinterval}" ]; then
3535
saveinterval="${autosaveinterval}"
3636
fi
3737

38+
if [ "${shortname}" == "st" ]; then
39+
if [ -n "${worldname}" ]; then
40+
worldsave="${worldname}"
41+
fi
42+
fi
43+
3844
# Added as part of migrating functions dir to modules dir.
3945
# Will remove functions dir if files in modules dir older than 14 days
4046
functionsdir="${lgsmdir}/modules"

lgsm/modules/info_game.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ fn_info_game_st() {
673673
saveinterval="${saveinterval:-"0"}"
674674
servername="${servername:-"NOT SET"}"
675675
serverpassword="${serverpassword:-"NOT SET"}"
676-
worldname="${worldname:-"NOT SET"}"
676+
worldsave="${worldsave:-"NOT SET"}"
677677
worldtype="${worldtype:-"NOT SET"}"
678678
}
679679

lgsm/modules/install_config.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,11 @@ elif [ "${shortname}" == "sb" ]; then
687687
fn_default_config_remote
688688
fn_set_config_vars
689689
fn_list_config_locations
690+
elif [ "${shortname}" == "st" ]; then
691+
array_configs+=(setting.xml)
692+
fn_default_config_remote
693+
fn_set_config_vars
694+
fn_list_config_locations
690695
elif [ "${shortname}" == "stn" ]; then
691696
array_configs+=(ServerConfig.txt ServerUsers.txt TpPresets.json UserPermissions.json)
692697
fn_default_config_remote

0 commit comments

Comments
 (0)