Browse Source

mumble to jk2

pull/3002/head
Daniel Gibbs 6 years ago
parent
commit
574d4ff80c
  1. 46
      lgsm/functions/update_jediknight2.sh

46
lgsm/functions/update_jediknight2.sh

@ -1,18 +1,18 @@
#!/bin/bash #!/bin/bash
# LinuxGSM update_mumble.sh function # LinuxGSM update_jk2.sh function
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Handles updating of Mumble servers. # Description: Handles updating of jk2 servers.
local commandname="UPDATE" local commandname="UPDATE"
local commandaction="Update" local commandaction="Update"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_update_mumble_dl(){ fn_update_jk2_dl(){
fn_fetch_file "https://github.com/mvdevs/jk2mv/releases/download/${remotebuild}/jk2mv-${remotebuild}-dedicated.zip" "${tmpdir}" "jk2mv-${remotebuild}-dedicated.zip" fn_fetch_file "https://github.com/mvdevs/jk2mv/releases/download/${remotebuild}/jk2mv-${remotebuild}-dedicated.zip" "${tmpdir}" "jk2mv-${remotebuild}-dedicated.zip"
fn_dl_extract "${tmpdir}" "jk2mv-${remotebuild}-dedicated.zip" "${tmpdir}" fn_dl_extract "${tmpdir}" "jk2mv-${remotebuild}-dedicated.zip" "${tmpdir}"
echo -e "copying to ${serverfiles}...\c" echo -e "copying to ${serverfiles}...\c"
cp -R "${tmpdir}/murmur-static_${mumblearch}-${remotebuild}/"* "${serverfiles}" cp -R "${tmpdir}/murmur-static_${jk2arch}-${remotebuild}/"* "${serverfiles}"
local exitcode=$? local exitcode=$?
if [ "${exitcode}" == "0" ]; then if [ "${exitcode}" == "0" ]; then
fn_print_ok_eol_nl fn_print_ok_eol_nl
@ -25,7 +25,7 @@ fn_update_mumble_dl(){
fi fi
} }
fn_update_mumble_localbuild(){ fn_update_jk2_localbuild(){
# Gets local build info. # Gets local build info.
fn_print_dots "Checking for update: ${remotelocation}: checking local build" fn_print_dots "Checking for update: ${remotelocation}: checking local build"
# Uses executable to find local build. # Uses executable to find local build.
@ -41,7 +41,7 @@ fn_update_mumble_localbuild(){
fi fi
} }
fn_update_mumble_remotebuild(){ fn_update_jk2_remotebuild(){
# Gets remote build info. # Gets remote build info.
remotebuild=$(${curlpath}-s "https://api.github.com/repos/mvdevs/jk2mv/releases/latest"| grep dedicated.zip | tail -1 | awk -F"/" '{ print $8 }') remotebuild=$(${curlpath}-s "https://api.github.com/repos/mvdevs/jk2mv/releases/latest"| grep dedicated.zip | tail -1 | awk -F"/" '{ print $8 }')
if [ "${installer}" != "1" ]; then if [ "${installer}" != "1" ]; then
@ -65,7 +65,7 @@ fn_update_mumble_remotebuild(){
fi fi
} }
fn_update_mumble_compare(){ fn_update_jk2_compare(){
# Removes dots so if statement can compare version numbers. # Removes dots so if statement can compare version numbers.
fn_print_dots "Checking for update: ${remotelocation}" fn_print_dots "Checking for update: ${remotelocation}"
localbuilddigit=$(echo "${localbuild}" | tr -cd '[:digit:]') localbuilddigit=$(echo "${localbuild}" | tr -cd '[:digit:]')
@ -74,11 +74,11 @@ fn_update_mumble_compare(){
fn_print_ok_nl "Checking for update: ${remotelocation}" fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n" echo -en "\n"
echo -e "Update available" echo -e "Update available"
echo -e "* Local build: ${red}${localbuild} ${mumblearch}${default}" echo -e "* Local build: ${red}${localbuild} ${jk2arch}${default}"
echo -e "* Remote build: ${green}${remotebuild} ${mumblearch}${default}" echo -e "* Remote build: ${green}${remotebuild} ${jk2arch}${default}"
fn_script_log_info "Update available" fn_script_log_info "Update available"
fn_script_log_info "Local build: ${localbuild} ${mumblearch}" fn_script_log_info "Local build: ${localbuild} ${jk2arch}"
fn_script_log_info "Remote build: ${remotebuild} ${mumblearch}" fn_script_log_info "Remote build: ${remotebuild} ${jk2arch}"
fn_script_log_info "${localbuild} > ${remotebuild}" fn_script_log_info "${localbuild} > ${remotebuild}"
fn_sleep_time fn_sleep_time
echo -en "\n" echo -en "\n"
@ -96,7 +96,7 @@ fn_update_mumble_compare(){
# If server stopped. # If server stopped.
if [ "${status}" == "0" ]; then if [ "${status}" == "0" ]; then
exitbypass=1 exitbypass=1
fn_update_mumble_dl fn_update_jk2_dl
exitbypass=1 exitbypass=1
command_start.sh command_start.sh
exitbypass=1 exitbypass=1
@ -106,7 +106,7 @@ fn_update_mumble_compare(){
exitbypass=1 exitbypass=1
command_stop.sh command_stop.sh
exitbypass=1 exitbypass=1
fn_update_mumble_dl fn_update_jk2_dl
exitbypass=1 exitbypass=1
command_start.sh command_start.sh
fi fi
@ -116,11 +116,11 @@ fn_update_mumble_compare(){
fn_print_ok_nl "Checking for update: ${remotelocation}" fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n" echo -en "\n"
echo -e "No update available" echo -e "No update available"
echo -e "* Local build: ${green}${localbuild} ${mumblearch}${default}" echo -e "* Local build: ${green}${localbuild} ${jk2arch}${default}"
echo -e "* Remote build: ${green}${remotebuild} ${mumblearch}${default}" echo -e "* Remote build: ${green}${remotebuild} ${jk2arch}${default}"
fn_script_log_info "No update available" fn_script_log_info "No update available"
fn_script_log_info "Local build: ${localbuild} ${mumblearch}" fn_script_log_info "Local build: ${localbuild} ${jk2arch}"
fn_script_log_info "Remote build: ${remotebuild} ${mumblearch}" fn_script_log_info "Remote build: ${remotebuild} ${jk2arch}"
fi fi
} }
@ -128,15 +128,15 @@ fn_update_mumble_compare(){
remotelocation="jk2mv.org" remotelocation="jk2mv.org"
# Game server architecture. # Game server architecture.
mumblearch="x86" jk2arch="x86"
if [ "${installer}" == "1" ]; then if [ "${installer}" == "1" ]; then
fn_update_mumble_remotebuild fn_update_jk2_remotebuild
fn_update_mumble_dl fn_update_jk2_dl
else else
fn_print_dots "Checking for update: ${remotelocation}" fn_print_dots "Checking for update: ${remotelocation}"
fn_script_log_info "Checking for update: ${remotelocation}" fn_script_log_info "Checking for update: ${remotelocation}"
fn_update_mumble_localbuild fn_update_jk2_localbuild
fn_update_mumble_remotebuild fn_update_jk2_remotebuild
fn_update_mumble_compare fn_update_jk2_compare
fi fi

Loading…
Cancel
Save