Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
8df33be
refactor: shorten module update function names
dgibbs64 Jun 10, 2023
4cc8f8d
feat: Add Update Check workflow
dgibbs64 Jun 10, 2023
215c9a5
feat: Add concurrency group names to workflows
dgibbs64 Jun 10, 2023
d483c2a
refactor: Update script names for Minecraft, Factorio, Jedi Knight 2 …
dgibbs64 Jun 10, 2023
8df9e5c
feat: Add support for 32-bit architecture
dgibbs64 Jun 10, 2023
00dc5ce
feat: Add i386 architecture and install libstdc++6
dgibbs64 Jun 10, 2023
ebe76fb
feat: Update dependencies for LinuxGSM
dgibbs64 Jun 10, 2023
eaeb248
feat: Add update and force-update server functionality
dgibbs64 Jun 10, 2023
33eaf48
feat: Add dependencies for server installation
dgibbs64 Jun 10, 2023
c4119b4
steamcmd only
dgibbs64 Jun 11, 2023
5519a63
steamcmd
dgibbs64 Jun 11, 2023
ae985fd
test
dgibbs64 Jun 11, 2023
a57880d
test
dgibbs64 Jun 11, 2023
02de112
Merge branch 'develop' into feature/update-check
dgibbs64 Aug 28, 2023
8a35f64
refactor: improve random password generation in install_config.sh
dgibbs64 Aug 28, 2023
63840f2
refactor: remove redundant code and set default branch
dgibbs64 Aug 28, 2023
e92ee6c
test
dgibbs64 Aug 28, 2023
4a06a23
fix: fix steamcmd build version retrieval
dgibbs64 Aug 28, 2023
b0d2433
test
dgibbs64 Aug 30, 2023
da02a55
fix: GitHub Actions test failure
dgibbs64 Aug 30, 2023
821e798
Add steam user and password secret for jk2
dgibbs64 Aug 30, 2023
c308420
refactor: update steamuser and steampass paths in jk2server config
dgibbs64 Aug 30, 2023
0c610c7
refactor: update steamuser and steampass insertion in LGSM configuration
dgibbs64 Aug 30, 2023
452ce24
refactor: simplify steamuser and steampass insertion in update-check.yml
dgibbs64 Aug 30, 2023
384ff0d
feat: update steamuser and steampass in common.cfg
dgibbs64 Aug 30, 2023
c97b0f9
display output
dgibbs64 Sep 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/details-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:

concurrency:
group: ${{ github.ref_name }}
group: details-check-${{ github.ref_name }}
cancel-in-progress: true

jobs:
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/update-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Update Check
# This action will check that LinuxGSM is picking up game server config and parameter variables.
on:
workflow_dispatch:
push:

concurrency:
group: update-check-${{ github.ref_name }}
cancel-in-progress: true

jobs:
update-check:
continue-on-error: true
runs-on: ubuntu-latest

strategy:
matrix:
shortname: [css, fctr, jk2, mc, mcb, mta, pmc, ts3, ut99, vints]

steps:
- name: Download linuxgsm.sh
run: wget https://github.com/ghraw/GameServerManagers/LinuxGSM/${GITHUB_REF#refs/heads/}/linuxgsm.sh; chmod +x linuxgsm.sh

- name: Install dependencies
run: sudo dpkg --add-architecture i386; sudo apt-get update;

- name: Grab server
run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./linuxgsm.sh ${{ matrix.shortname }}server

- name: Enable developer mode
run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server developer

- name: Insert steamuser
if: matrix.shortname == 'jk2'
run: echo -e "steamuser=\"${{ secrets.STEAMCMD_USER }}\"\nsteampass='${{ secrets.STEAMCMD_PASS }}'" > lgsm/config-lgsm/${{ matrix.shortname }}server/common.cfg

- name: Install server
run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server auto-install

- name: Check Update server
run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server check-update

- name: Update server
run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server update

- name: Force Update server
if: matrix.shortname == 'css'
run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server force-update
12 changes: 6 additions & 6 deletions lgsm/modules/command_check_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ core_logs.sh
if [ "${shortname}" == "ts3" ]; then
update_ts3.sh
elif [ "${shortname}" == "mc" ]; then
update_minecraft.sh
update_mc.sh
elif [ "${shortname}" == "mcb" ]; then
update_minecraft_bedrock.sh
update_mcb.sh
elif [ "${shortname}" == "pmc" ] || [ "${shortname}" == "vpmc" ] || [ "${shortname}" == "wmc" ]; then
update_papermc.sh
update_pmc.sh
elif [ "${shortname}" == "fctr" ]; then
update_factorio.sh
update_fctr.sh
elif [ "${shortname}" == "mta" ]; then
update_mta.sh
elif [ "${shortname}" == "jk2" ]; then
update_jediknight2.sh
update_jk2.sh
elif [ "${shortname}" == "vints" ]; then
update_vintagestory.sh
update_vints.sh
elif [ "${shortname}" == "ut99" ]; then
update_ut99.sh
else
Expand Down
12 changes: 6 additions & 6 deletions lgsm/modules/command_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ check_last_update.sh
if [ "${shortname}" == "ts3" ]; then
update_ts3.sh
elif [ "${shortname}" == "mc" ]; then
update_minecraft.sh
update_mc.sh
elif [ "${shortname}" == "mcb" ]; then
update_minecraft_bedrock.sh
update_mcb.sh
elif [ "${shortname}" == "pmc" ] || [ "${shortname}" == "vpmc" ] || [ "${shortname}" == "wmc" ]; then
update_papermc.sh
update_pmc.sh
elif [ "${shortname}" == "fctr" ]; then
update_factorio.sh
update_fctr.sh
elif [ "${shortname}" == "mta" ]; then
update_mta.sh
elif [ "${shortname}" == "jk2" ]; then
update_jediknight2.sh
update_jk2.sh
elif [ "${shortname}" == "vints" ]; then
update_vintagestory.sh
update_vints.sh
elif [ "${shortname}" == "ut99" ]; then
update_ut99.sh
else
Expand Down
12 changes: 6 additions & 6 deletions lgsm/modules/core_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -640,17 +640,17 @@ update_ts3.sh() {
fn_fetch_function
}

update_minecraft.sh() {
update_mc.sh() {
functionfile="${FUNCNAME[0]}"
fn_fetch_function
}

update_minecraft_bedrock.sh() {
update_mcb.sh() {
functionfile="${FUNCNAME[0]}"
fn_fetch_function
}

update_papermc.sh() {
update_pmc.sh() {
functionfile="${FUNCNAME[0]}"
fn_fetch_function
}
Expand All @@ -660,12 +660,12 @@ update_mta.sh() {
fn_fetch_function
}

update_factorio.sh() {
update_fctr.sh() {
functionfile="${FUNCNAME[0]}"
fn_fetch_function
}

update_jediknight2.sh() {
update_jk2.sh() {
functionfile="${FUNCNAME[0]}"
fn_fetch_function
}
Expand All @@ -675,7 +675,7 @@ update_steamcmd.sh() {
fn_fetch_function
}

update_vintagestory.sh() {
update_vints.sh() {
functionfile="${FUNCNAME[0]}"
fn_fetch_function
}
Expand Down
12 changes: 6 additions & 6 deletions lgsm/modules/core_modules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -645,17 +645,17 @@ update_ts3.sh() {
fn_fetch_module
}

update_minecraft.sh() {
update_mc.sh() {
modulefile="${FUNCNAME[0]}"
fn_fetch_module
}

update_minecraft_bedrock.sh() {
update_mcb.sh() {
modulefile="${FUNCNAME[0]}"
fn_fetch_module
}

update_papermc.sh() {
update_pmc.sh() {
modulefile="${FUNCNAME[0]}"
fn_fetch_module
}
Expand All @@ -665,12 +665,12 @@ update_mta.sh() {
fn_fetch_module
}

update_factorio.sh() {
update_fctr.sh() {
modulefile="${FUNCNAME[0]}"
fn_fetch_module
}

update_jediknight2.sh() {
update_jk2.sh() {
modulefile="${FUNCNAME[0]}"
fn_fetch_module
}
Expand All @@ -680,7 +680,7 @@ update_steamcmd.sh() {
fn_fetch_module
}

update_vintagestory.sh() {
update_vints.sh() {
modulefile="${FUNCNAME[0]}"
fn_fetch_module
}
Expand Down
12 changes: 7 additions & 5 deletions lgsm/modules/core_steamcmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,6 @@ fn_update_steamcmd_localbuild() {
# Uses appmanifest to find local build.
localbuild=$(grep buildid "${appmanifestfile}" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\ -f3)

# Set branch to public if no custom branch.
if [ -z "${branch}" ]; then
branch="public"
fi

# Checks if localbuild variable has been set.
if [ -z "${localbuild}" ]; then
fn_print_fail "Checking local build: ${remotelocation}: missing local build info"
Expand All @@ -178,6 +173,13 @@ fn_update_steamcmd_remotebuild() {
find "${HOME}" -type f -name "appinfo.vdf" -exec rm -f {} \; 2> /dev/null
fi

# Set branch to public if no custom branch.
if [ -z "${branch}" ]; then
branch="public"
fi

# added as was failing GitHub Actions test. Running SteamCMD twice seems to fix it.
${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +quit 2> /dev/null
# password for branch not needed to check the buildid
remotebuildversion=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed -e '/"branches"/,/^}/!d' | sed -n "/\"${branch}\"/,/}/p" | grep -m 1 buildid | tr -cd '[:digit:]')

Expand Down
2 changes: 1 addition & 1 deletion lgsm/modules/install_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fn_default_config_local() {
# PASSWORD to random password
fn_set_config_vars() {
if [ -f "${servercfgfullpath}" ]; then
random=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 8 | xargs)
random=$(tr -dc 'A-Za-z0-9_' < /dev/urandom 2>/dev/null | head -c 8 | xargs)
servername="LinuxGSM"
rconpass="admin${random}"
echo -e "changing hostname."
Expand Down
14 changes: 7 additions & 7 deletions lgsm/modules/install_server_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -221,23 +221,23 @@ if [ "${shortname}" == "ts3" ]; then
update_ts3.sh
elif [ "${shortname}" == "mc" ]; then
install_eula.sh
update_minecraft.sh
update_mc.sh
elif [ "${shortname}" == "mcb" ]; then
update_minecraft_bedrock.sh
update_mcb.sh
elif [ "${shortname}" == "pmc" ]; then
install_eula.sh
update_papermc.sh
update_pmc.sh
elif [ "${shortname}" == "wmc" ] || [ "${shortname}" == "vpmc" ]; then
update_papermc.sh
update_pmc.sh
elif [ "${shortname}" == "mta" ]; then
update_mta.sh
elif [ "${shortname}" == "fctr" ]; then
update_factorio.sh
update_fctr.sh
install_factorio_save.sh
elif [ "${shortname}" == "jk2" ]; then
update_jediknight2.sh
update_jk2.sh
elif [ "${shortname}" == "vints" ]; then
update_vintagestory.sh
update_vints.sh
elif [ "${shortname}" == "ut99" ]; then
fn_install_server_files
update_ut99.sh
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# LinuxGSM update_factorio.sh module
# LinuxGSM update_fctr.sh module
# Author: Daniel Gibbs
# Contributors: http://linuxgsm.com/contrib
# Website: https://linuxgsm.com
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# LinuxGSM update_minecraft.sh module
# LinuxGSM update_mc.sh module
# Author: Daniel Gibbs
# Contributors: http://linuxgsm.com/contrib
# Website: https://linuxgsm.com
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# LinuxGSM update_minecraft_bedrock.sh module
# LinuxGSM update_mcb.sh module
# Author: Daniel Gibbs
# Contributors: http://linuxgsm.com/contrib
# Website: https://linuxgsm.com
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# LinuxGSM update_papermc.sh module
# LinuxGSM update_pmc.sh module
# Author: Daniel Gibbs
# Contributors: http://linuxgsm.com/contrib
# Website: https://linuxgsm.com
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# LinuxGSM update_vintagestory.sh module
# LinuxGSM update_vints.sh module
# Author: Daniel Gibbs
# Contributors: http://linuxgsm.com/contrib
# Website: https://linuxgsm.com
Expand Down