Browse Source

updated if

pull/3002/head
Daniel Gibbs 5 years ago
parent
commit
6f8a113f2f
  1. 1
      lgsm/functions/command_install.sh
  2. 4
      lgsm/functions/update_factorio.sh
  3. 8
      lgsm/functions/update_jediknight2.sh
  4. 4
      lgsm/functions/update_minecraft.sh
  5. 6
      lgsm/functions/update_minecraft_bedrock.sh
  6. 4
      lgsm/functions/update_mta.sh
  7. 4
      lgsm/functions/update_mumble.sh
  8. 2
      lgsm/functions/update_steamcmd.sh
  9. 4
      lgsm/functions/update_ts3.sh

1
lgsm/functions/command_install.sh

@ -24,7 +24,6 @@ else
install_server_files.sh
install_ut2k4_key.sh
elif [ -z "${appid}" ]; then
installer=1
install_server_files.sh
elif [ "${appid}" ]; then
install_steamcmd.sh

4
lgsm/functions/update_factorio.sh

@ -43,7 +43,7 @@ fn_update_factorio_localbuild(){
fn_update_factorio_remotebuild(){
# Gets remote build info.
remotebuild=$(curl -s "https://factorio.com/get-download/${downloadbranch}/headless/${factorioarch}" | grep -o '[0-9]\.[0-9]\{1,\}\.[0-9]\{1,\}' | head -1)
if [ "${installer}" != "1" ]; then
if [ "${firstcommandname}" != "INSTALL" ]; then
fn_print_dots "Checking remote build: ${remotelocation}"
# Checks if remotebuild variable has been set.
if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then
@ -148,7 +148,7 @@ else
downloadbranch="${branch}"
fi
if [ "${installer}" == "1" ]; then
if [ "${firstcommandname}" == "INSTALL" ]; then
fn_update_factorio_remotebuild
fn_update_factorio_dl
else

8
lgsm/functions/update_jediknight2.sh

@ -28,10 +28,6 @@ fn_update_jk2_dl(){
fn_update_jk2_localbuild(){
# Gets local build info.
fn_print_dots "Checking local build: ${remotelocation}"
# Set localbuild to 0 if running installer
if [ "${firstcommandname}" == "INSTALL" ]; then
localbuild=0
fi
# Uses log file to gather info.
# Log is generated and cleared on startup but filled on shutdown.
localbuild=$(grep "\"version\"" "${consolelogdir}"/* 2>/dev/null | sed 's/.*://' | awk '{print $1}' | head -n 1)
@ -78,7 +74,7 @@ fn_update_jk2_localbuild(){
fn_update_jk2_remotebuild(){
# Gets remote build info.
remotebuild=$(curl -s "https://api.github.com/repos/mvdevs/jk2mv/releases/latest" | grep dedicated.zip | tail -1 | awk -F"/" '{ print $8 }')
if [ "${installer}" != "1" ]; then
if [ "${firstcommandname}" != "INSTALL" ]; then
fn_print_dots "Checking remote build: ${remotelocation}"
# Checks if remotebuild variable has been set.
if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then
@ -161,7 +157,7 @@ remotelocation="jk2mv.org"
# Game server architecture.
jk2arch="x64"
if [ "${installer}" == "1" ]; then
if [ "${firstcommandname}" == "INSTALL" ]; then
fn_update_jk2_remotebuild
fn_update_jk2_dl
else

4
lgsm/functions/update_minecraft.sh

@ -83,7 +83,7 @@ fn_update_minecraft_remotebuild(){
remotebuild=$(curl -s "https://launchermeta.${remotelocation}/mc/game/version_manifest.json" | jq -r '.versions[0].id')
fi
if [ "${installer}" != "1" ]; then
if [ "${firstcommandname}" != "INSTALL" ]; then
fn_print_dots "Checking remote build: ${remotelocation}"
# Checks if remotebuild variable has been set.
if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then
@ -170,7 +170,7 @@ fn_update_minecraft_compare(){
# The location where the builds are checked and downloaded.
remotelocation="mojang.com"
if [ "${installer}" == "1" ]; then
if [ "${firstcommandname}" == "INSTALL" ]; then
fn_update_minecraft_remotebuild
fn_update_minecraft_dl
else

6
lgsm/functions/update_minecraft_bedrock.sh

@ -10,7 +10,7 @@ fn_update_minecraft_dl(){
latestmcbuildurl=$(curl -s "https://www.minecraft.net/en-us/download/server/bedrock/" | grep -o 'https://minecraft.azureedge.net/bin-linux/[^"]*zip')
fn_fetch_file "${latestmcbuildurl}" "" "" "" "${tmpdir}" "bedrock_server.${remotebuild}.zip"
echo -e "Extracting to ${serverfiles}...\c"
if [ "${installer}" == "1" ]; then
if [ "${firstcommandname}" == "INSTALL" ]; then
unzip -oq "${tmpdir}/bedrock_server.${remotebuild}.zip" -x "server.properties" -d "${serverfiles}"
else
unzip -oq "${tmpdir}/bedrock_server.${remotebuild}.zip" -x "permissions.json" "server.properties" "whitelist.json" -d "${serverfiles}"
@ -78,7 +78,7 @@ fn_update_minecraft_localbuild(){
fn_update_minecraft_remotebuild(){
# Gets remote build info.
remotebuild=$(curl -s "https://www.minecraft.net/en-us/download/server/bedrock/" | grep -o 'https://minecraft.azureedge.net/bin-linux/[^"]*' | sed 's/.*\///' | grep -Eo "[.0-9]+[0-9]")
if [ "${installer}" != "1" ]; then
if [ "${firstcommandname}" != "INSTALL" ]; then
fn_print_dots "Checking remote build: ${remotelocation}"
# Checks if remotebuild variable has been set.
if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then
@ -158,7 +158,7 @@ fn_update_minecraft_compare(){
# The location where the builds are checked and downloaded.
remotelocation="minecraft.net"
if [ "${installer}" == "1" ]; then
if [ "${firstcommandname}" == "INSTALL" ]; then
fn_update_minecraft_remotebuild
fn_update_minecraft_dl
else

4
lgsm/functions/update_mta.sh

@ -101,7 +101,7 @@ fn_update_mta_remotebuild(){
minorversion=$(curl -s https://raw.githubusercontent.com/multitheftauto/mtasa-blue/master/Server/version.h | grep "#define MTASA_VERSION_MINOR" | awk '{ print $3 }' | sed 's/\r//g')
maintenanceversion=$(curl -s https://raw.githubusercontent.com/multitheftauto/mtasa-blue/master/Server/version.h | grep "#define MTASA_VERSION_MAINTENANCE" | awk '{ print $3 }' | sed 's/\r//g')
remotebuild="${majorversion}.${minorversion}.${maintenanceversion}"
if [ "${installer}" != "1" ]; then
if [ "${firstcommandname}" != "INSTALL" ]; then
fn_print_dots "Checking remote build: ${remotelocation}"
# Checks if remotebuild variable has been set.
if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then
@ -187,7 +187,7 @@ fn_update_mta_compare(){
# The location where the builds are checked and downloaded.
remotelocation="linux.mtasa.com"
if [ "${installer}" == "1" ]; then
if [ "${firstcommandname}" == "INSTALL" ]; then
fn_update_mta_remotebuild
fn_update_mta_dl
else

4
lgsm/functions/update_mumble.sh

@ -43,7 +43,7 @@ fn_update_mumble_localbuild(){
fn_update_mumble_remotebuild(){
# Gets remote build info.
remotebuild=$(curl -s "https://api.github.com/repos/mumble-voip/mumble/releases/latest" | grep 'murmur-static_x86.*\.bz2"' | tail -1 | awk -F"/" '{ print $8 }')
if [ "${installer}" != "1" ]; then
if [ "${firstcommandname}" != "INSTALL" ]; then
fn_print_dots "Checking remote build: ${remotelocation}"
# Checks if remotebuild variable has been set.
if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then
@ -126,7 +126,7 @@ remotelocation="mumble.info"
# Game server architecture.
mumblearch="x86"
if [ "${installer}" == "1" ]; then
if [ "${firstcommandname}" == "INSTALL" ]; then
fn_update_mumble_remotebuild
fn_update_mumble_dl
else

2
lgsm/functions/update_steamcmd.sh

@ -48,7 +48,7 @@ fn_update_steamcmd_remotebuild(){
remotebuild=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed '1,/branches/d' | sed "1,/${branch}/d" | grep -m 1 buildid | tr -cd '[:digit:]')
fi
if [ "${installer}" != "1" ]; then
if [ "${firstcommandname}" != "INSTALL" ]; then
fn_print_dots "Checking remote build: ${remotelocation}"
# Checks if remotebuild variable has been set.
if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then

4
lgsm/functions/update_ts3.sh

@ -106,7 +106,7 @@ fn_update_ts3_remotebuild(){
elif [ "${arch}" == "x86" ]; then
remotebuild=$(curl -s "https://www.teamspeak.com/versions/server.json" | jq -r '.linux.x86.version')
fi
if [ "${installer}" != "1" ]; then
if [ "${firstcommandname}" != "INSTALL" ]; then
fn_print_dots "Checking remote build: ${remotelocation}"
# Checks if remotebuild variable has been set.
if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then
@ -197,7 +197,7 @@ fi
# The location where the builds are checked and downloaded.
remotelocation="teamspeak.com"
if [ "${installer}" == "1" ]; then
if [ "${firstcommandname}" == "INSTALL" ]; then
fn_update_ts3_remotebuild
fn_update_ts3_dl
else

Loading…
Cancel
Save