This commit is contained in:
2023-05-02 18:35:19 -05:00
parent 763e0ad7a9
commit b2e43f290d
2 changed files with 8 additions and 18 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash
VERS='3.8.200-04292023'
VERS='3.8.206-04292023'
MMFOLDER="/opt/idssys/mediamanager"
MMSRV=$(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1)

View File

@@ -859,9 +859,7 @@ UPDATESERVICE(){
if [[ " ${UPDATE_SERVICES[*]} " =~ " ${usrvc} " ]]; then
if [ "${MM_UPDATE_REPO[${usrvc}]}" != "" ] && [ "${MM_UPDATE_REPO[${usrvc}]}" != "systemd" ]; then
msg="Finding latest update url"
c=0; spc=''; spc1=$((${cw_spc}-${#msg}))
until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
msg="Checking for update"; c=0; spc=''; spc1=$((${cw_spc}-${#msg})); until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
echo -en "${idsCL[White]}${msg}${spc} : ${idsCL[Default]}"
if [[ $BETA_SERVICES == *${usrvc}* ]]; then
@@ -873,18 +871,11 @@ UPDATESERVICE(){
echo "$(date) - Updating Service (${usrvc}) : UPDATEURL = ${latest_release_url}" >> $logfile
beta=""
fi
installed_ver=`echo ${latest_release_url} | cut -d/ -f8`
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
msg="Latest Version"; c=0; spc=''; spc1=$((${cw_spc}-${#msg})); until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
echo -e "${idsCL[White]}${msg}${spc} : ${idsCL[Green]}${installed_ver}${idsCL[Default]}"
latest_ver=`echo ${latest_release_url} | cut -d/ -f8`
cver=${usrvc}_VER
msg="Current Version"; c=0; spc=''; spc1=$((${cw_spc}-${#msg})); until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
echo -e "${idsCL[White]}${msg}${spc} : ${idsCL[Green]}${!cver}${idsCL[Default]}"
if [ "${!cver}" != "${installed_ver}" ] || [ "${2}" == "force" ]; then
echo -e "${idsCL[LightCyan]} Update Not Needed, but force option was chosen${idsCL[Default]}"
if [ "${!cver}" != "${latest_ver}" ] || [ "${2}" == "force" ]; then
[ "${2}" == "force" ] && echo -e "${idsCL[LightCyan]} Update Not Needed, but forcing anyway${idsCL[Default]}" || echo -e "${idsCL[Green]}Done${idsCL[Default]}"
tmpfile=/tmp/${usrvc}-update.tar.gz
bak=/opt/Backups/${usrvc}.opt.tgz
@@ -935,7 +926,7 @@ UPDATESERVICE(){
[ ! -f ${MMFOLDER}/vers.info ] && touch ${MMFOLDER}/vers.info
/bin/sed -i /${usrvc}/d ${MMFOLDER}/vers.info
echo "${usrvc}_VER=\"${installed_ver}\"" >> ${MMFOLDER}/vers.info
echo "${usrvc}_VER=\"${latest_ver}\"" >> ${MMFOLDER}/vers.info
msg="Starting service back up"; c=0; spc=''; spc1=$((${cw_spc}-${#msg})); until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
echo -en "${idsCL[White]}${msg}${spc} : ${idsCL[Default]}"
@@ -954,7 +945,7 @@ UPDATESERVICE(){
echo -e "${idsCL[Green]}${usrvc^} Service has been updated${idsCL[Default]}"
else
echo -e "${idsCL[LightCyan]} Update Not Needed ${idsCL[Default]}"
echo -e "${idsCL[LightCyan]}Update Not Needed${idsCL[Default]}"
echo "$(date) - Updating Service (${usrvc}) : Update Not Needed" >> $logfile
fi
@@ -966,7 +957,6 @@ UPDATESERVICE(){
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
msg="Updating service"; c=0; spc=''; spc1=$((${cw_spc}-${#msg})); until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
echo -en "${idsCL[White]}${msg}${spc} : ${idsCL[Default]}"
installed_ver=`dpkg -s ${usrvc} | grep Version`
/usr/bin/apt install ${usrvc} >/dev/null 2>&1
/bin/systemctl disable ${usrvc} >/dev/null 2>&1
echo -e "${idsCL[Green]}Done${idsCL[Default]}"