#!/bin/bash DIR=$(cd -P -- "$(dirname -- "$0")" && pwd -P) export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin BUILD="" while getopts b: option do case "${option}" in b) BUILD=${OPTARG};; esac done MASTERLINK="http://install.uavmatrix.com/UAVcast-Pro_master.tar" ALFALINK="http://install.uavmatrix.com/UAVcast-Pro_alfa.tar" BETALINK="http://install.uavmatrix.com/UAVcast-Pro_beta.tar" ROLLBACK="http://install.uavmatrix.com/UAVcast-Pro_rback.tar" #LINK="1ZjuyQnuqkAZ2nY_Pyj7c0A5x5oHNbBVx" version 3.1.6 RUNINSTALL="true" FILENAME="UAVcast-Pro.tar" # Set default link to master DOWNLOADLINK=${MASTERLINK} if [[ $BUILD == "alfa" ]]; then DOWNLOADLINK=${ALFALINK} elif [[ $BUILD == "beta" ]]; then DOWNLOADLINK=${BETALINK} elif [[ $BUILD == "rback" ]]; then DOWNLOADLINK=${ROLLBACK} fi updateApplication(){ # echo "Update in progress "+ $VERSION sleep 1 curl ${DOWNLOADLINK} -o /tmp/${FILENAME} sudo tar -xvf /tmp/${FILENAME} -C /opt > /dev/null 2>&1 cd /opt/UAVcast-Pro/install/ sudo ./install sleep 3 rm -r /tmp/${FILENAME} #Restart Server if ! systemctl is-active --quiet UAVcast-Web then sudo systemctl enable UAVcast-Web sudo systemctl start UAVcast-Web else sudo systemctl restart UAVcast-Web fi } updateApplication