Browse Source

Spacing and quote

pull/947/head
UltimateByte 9 years ago
committed by GitHub
parent
commit
a289e4d574
  1. 46
      lgsm/functions/update_mumble.sh

46
lgsm/functions/update_mumble.sh

@ -39,8 +39,8 @@ fn_update_mumble_currentbuild(){
# Gets current build info
fn_print_info "Checking current server build"
sleep 1
# Checks if current build info is available. If it fails, then a server restart will be forced to generate logs.
if [ ! -f ""${consolelogdir}"/"${servicename}"-console.log" ]; then
# Checks if current build info is available. If it fails, then a server restart will be forced to generate logs.
if [ ! -f ""${consolelogdir}"/"${servicename}"-console.log" ]; then
fn_print_info_nl "No current log found, can't retrieve current server build"
fn_script_log_info "No current log found, can't retrieve current server build"
sleep 1
@ -54,20 +54,20 @@ sleep 1
sleep 1
# Check again and exit on failure.
if [ ! -f ""${consolelogdir}"/"${servicename}"-console.log" ]; then
fn_print_fail_nl "Still no logs found, can't retrieve server version
fn_script_log_fatal "Still no logs found, can't retrieve server version"
fn_print_fail_nl "Still no logs found, cannot retrieve server version"
fn_script_log_fatal "Still no logs found, cannot retrieve server version"
core_exit.sh
else
fn_print_ok_nl "Logs found"
fn_script_log "Logs found"
sleep 1
fi
fi
fi
# Get current build from logs
currentbuild=$(cat "${consolelogdir}"/"${servicename}"-console.log 2> /dev/null | sort | egrep 'Murmur ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | awk '{print $4}')
if [ -z "${currentbuild}" ]; then
if [ -z "${currentbuild}" ]; then
fn_print_info_nl "Can't find current build version in logs"
fn_script_log_error "Can't find current build version in logs"
sleep 1
@ -83,15 +83,15 @@ currentbuild=$(cat "${consolelogdir}"/"${servicename}"-console.log 2> /dev/null
fn_script_log_fatal "Sorry, current build version still not found"
core_exit.sh
fi
fi
fi
}
fn_update_mumble_compare(){
# Removes dots so if can compare version numbers
currentbuilddigit=$(echo "${currentbuild}"|tr -cd '[:digit:]')
availablebuilddigit=$(echo "${availablebuild}"|tr -cd '[:digit:]')
# Removes dots so if can compare version numbers
currentbuilddigit=$(echo "${currentbuild}"|tr -cd '[:digit:]')
availablebuilddigit=$(echo "${availablebuild}"|tr -cd '[:digit:]')
if [ "${currentbuilddigit}" -ne "${availablebuilddigit}" ]; then
if [ "${currentbuilddigit}" -ne "${availablebuilddigit}" ]; then
echo -e "\n"
echo -e "Update available:"
sleep 1
@ -130,7 +130,7 @@ fn_update_mumble_compare(){
fi
alert="update"
alert.sh
else
else
echo -e "\n"
echo -e "No update available:"
echo -e " Current version: ${green}${currentbuild}${default}"
@ -139,22 +139,22 @@ fn_update_mumble_compare(){
fn_print_ok_nl "No update available"
fn_script_log_info "Current build: ${currentbuild}"
fn_script_log_info "Available build: ${availablebuild}"
fi
fi
}
fn_update_mumble_dl(){
mumblefilename="murmur-static_${mumblearch}-${mumble_version_number}.tar.bz2"
fn_fetch_file "https://github.com/mumble-voip/mumble/releases/download/${mumblefilename}" "${lgsmdir}/tmp" "${mumblefilename}"
fn_dl_extract "${lgsmdir}/tmp" "${mumblefilename}" "${lgsmdir}/tmp"
echo -e "copying to ${filesdir}...\c"
fn_script_log "Copying to ${filesdir}"
cp -R "${lgsmdir}/tmp/murmur-static_${mumblearch}-${mumble_version_number}/"* "${filesdir}"
local exitcode=$?
if [ ${exitcode} -eq 0 ]; then
mumblefilename="murmur-static_${mumblearch}-${mumble_version_number}.tar.bz2"
fn_fetch_file "https://github.com/mumble-voip/mumble/releases/download/${mumblefilename}" "${lgsmdir}/tmp" "${mumblefilename}"
fn_dl_extract "${lgsmdir}/tmp" "${mumblefilename}" "${lgsmdir}/tmp"
echo -e "copying to ${filesdir}...\c"
fn_script_log "Copying to ${filesdir}"
cp -R "${lgsmdir}/tmp/murmur-static_${mumblearch}-${mumble_version_number}/"* "${filesdir}"
local exitcode=$?
if [ ${exitcode} -eq 0 ]; then
fn_print_ok_eol_nl
else
else
fn_print_fail_eol_nl
fi
fi
}
fn_update_mubmle_arch

Loading…
Cancel
Save