@ -39,7 +39,7 @@ fn_update_remotebuild() {
remotebuildresponse = $( curl -s " ${ apiurl } " )
remotebuildfilename = "multitheftauto_linux_x64.tar.gz"
remotebuildurl = "http://linux.mtasa.com/dl/multitheftauto_linux_x64.tar.gz"
remotebuildversion = $( echo "${ remotebuildresponse } " )
remotebuildversion = "${ remotebuildresponse } "
if [ " ${ firstcommandname } " != "INSTALL" ] ; then
fn_print_dots " Checking remote build: ${ remotelocation } "
# Checks if remotebuildversion variable has been set.
@ -74,21 +74,21 @@ fn_update_compare() {
mtaupdatestatus = "available"
fi
fn_print_ok_nl " Checking for update: ${ remotelocation } "
echo -en "\n"
echo -e "Update available "
echo -e " * Local build: ${ red } ${ localbuild } ${ default } "
echo -e " * Remote build: ${ green } ${ remotebuildversion } ${ default } "
fn_print "\n"
fn_print_nl " ${ bold } ${ underline } Update ${ default } available "
fn_print_nl " * Local build: ${ red } ${ localbuild } ${ default } "
fn_print_nl " * Remote build: ${ green } ${ remotebuildversion } ${ default } "
if [ -n " ${ branch } " ] ; then
echo -e " * Branch: ${ branch } "
fn_print_nl " * Branch: ${ branch } "
fi
if [ -f " ${ rootdir } /.dev-debug " ] ; then
echo -e "Remote build info"
echo -e " * apiurl: ${ apiurl } "
echo -e " * remotebuildfilename: ${ remotebuildfilename } "
echo -e " * remotebuildurl: ${ remotebuildurl } "
echo -e " * remotebuildversion: ${ remotebuildversion } "
fn_print_nl "Remote build info"
fn_print_nl " * apiurl: ${ apiurl } "
fn_print_nl " * remotebuildfilename: ${ remotebuildfilename } "
fn_print_nl " * remotebuildurl: ${ remotebuildurl } "
fn_print_nl " * remotebuildversion: ${ remotebuildversion } "
fi
echo -en "\n"
fn_print "\n"
fn_script_log_info "Update available"
fn_script_log_info " Local build: ${ localbuild } "
fn_script_log_info " Remote build: ${ remotebuildversion } "
@ -98,6 +98,7 @@ fn_update_compare() {
fn_script_log_info " ${ localbuild } > ${ remotebuildversion } "
if [ " ${ commandname } " = = "UPDATE" ] ; then
date +%s > " ${ lockdir : ? } /last-updated.lock "
unset updateonstart
check_status.sh
# If server stopped.
@ -125,7 +126,6 @@ fn_update_compare() {
fn_firstcommand_reset
fi
unset exitbypass
date +%s > " ${ lockdir } /last-updated.lock "
alert = "update"
elif [ " ${ commandname } " = = "CHECK-UPDATE" ] ; then
alert = "check-update"
@ -133,14 +133,14 @@ fn_update_compare() {
alert.sh
else
fn_print_ok_nl " Checking for update: ${ remotelocation } "
echo -en "\n"
echo -e "No update available "
echo -e " * Local build: ${ green } ${ localbuild } ${ default } "
echo -e " * Remote build: ${ green } ${ remotebuildversion } ${ default } "
fn_print "\n"
fn_print_nl " ${ bold } ${ underline } No update ${ default } available "
fn_print_nl " * Local build: ${ green } ${ localbuild } ${ default } "
fn_print_nl " * Remote build: ${ green } ${ remotebuildversion } ${ default } "
if [ -n " ${ branch } " ] ; then
echo -e " * Branch: ${ branch } "
fn_print_nl " * Branch: ${ branch } "
fi
echo -en "\n"
fn_print "\n"
fn_script_log_info "No update available"
fn_script_log_info " Local build: ${ localbuild } "
fn_script_log_info " Remote build: ${ remotebuildversion } "
@ -148,11 +148,11 @@ fn_update_compare() {
fn_script_log_info " Branch: ${ branch } "
fi
if [ -f " ${ rootdir } /.dev-debug " ] ; then
echo -e "Remote build info"
echo -e " * apiurl: ${ apiurl } "
echo -e " * remotebuildfilename: ${ remotebuildfilename } "
echo -e " * remotebuildurl: ${ remotebuildurl } "
echo -e " * remotebuildversion: ${ remotebuildversion } "
fn_print_nl "Remote build info"
fn_print_nl " * apiurl: ${ apiurl } "
fn_print_nl " * remotebuildfilename: ${ remotebuildfilename } "
fn_print_nl " * remotebuildurl: ${ remotebuildurl } "
fn_print_nl " * remotebuildversion: ${ remotebuildversion } "
fi
fi
}
@ -160,12 +160,6 @@ fn_update_compare() {
# The location where the builds are checked and downloaded.
remotelocation = "linux.mtasa.com"
if [ ! " $( command -v jq 2> /dev/null) " ] ; then
fn_print_fail_nl "jq is not installed"
fn_script_log_fail "jq is not installed"
core_exit.sh
fi
if [ " ${ firstcommandname } " = = "INSTALL" ] ; then
fn_update_remotebuild
fn_update_dl