update
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
VERS='3.8.200-04292023'
|
VERS='3.8.206-04292023'
|
||||||
|
|
||||||
MMFOLDER="/opt/idssys/mediamanager"
|
MMFOLDER="/opt/idssys/mediamanager"
|
||||||
MMSRV=$(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1)
|
MMSRV=$(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1)
|
||||||
|
|||||||
@@ -859,9 +859,7 @@ UPDATESERVICE(){
|
|||||||
if [[ " ${UPDATE_SERVICES[*]} " =~ " ${usrvc} " ]]; then
|
if [[ " ${UPDATE_SERVICES[*]} " =~ " ${usrvc} " ]]; then
|
||||||
if [ "${MM_UPDATE_REPO[${usrvc}]}" != "" ] && [ "${MM_UPDATE_REPO[${usrvc}]}" != "systemd" ]; then
|
if [ "${MM_UPDATE_REPO[${usrvc}]}" != "" ] && [ "${MM_UPDATE_REPO[${usrvc}]}" != "systemd" ]; then
|
||||||
|
|
||||||
msg="Finding latest update url"
|
msg="Checking for update"; c=0; spc=''; spc1=$((${cw_spc}-${#msg})); until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
|
||||||
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]}"
|
echo -en "${idsCL[White]}${msg}${spc} : ${idsCL[Default]}"
|
||||||
|
|
||||||
if [[ $BETA_SERVICES == *${usrvc}* ]]; then
|
if [[ $BETA_SERVICES == *${usrvc}* ]]; then
|
||||||
@@ -873,18 +871,11 @@ UPDATESERVICE(){
|
|||||||
echo "$(date) - Updating Service (${usrvc}) : UPDATEURL = ${latest_release_url}" >> $logfile
|
echo "$(date) - Updating Service (${usrvc}) : UPDATEURL = ${latest_release_url}" >> $logfile
|
||||||
beta=""
|
beta=""
|
||||||
fi
|
fi
|
||||||
installed_ver=`echo ${latest_release_url} | cut -d/ -f8`
|
latest_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]}"
|
|
||||||
|
|
||||||
cver=${usrvc}_VER
|
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}" != "${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]}"
|
||||||
if [ "${!cver}" != "${installed_ver}" ] || [ "${2}" == "force" ]; then
|
|
||||||
echo -e "${idsCL[LightCyan]} Update Not Needed, but force option was chosen${idsCL[Default]}"
|
|
||||||
|
|
||||||
tmpfile=/tmp/${usrvc}-update.tar.gz
|
tmpfile=/tmp/${usrvc}-update.tar.gz
|
||||||
bak=/opt/Backups/${usrvc}.opt.tgz
|
bak=/opt/Backups/${usrvc}.opt.tgz
|
||||||
@@ -935,7 +926,7 @@ UPDATESERVICE(){
|
|||||||
|
|
||||||
[ ! -f ${MMFOLDER}/vers.info ] && touch ${MMFOLDER}/vers.info
|
[ ! -f ${MMFOLDER}/vers.info ] && touch ${MMFOLDER}/vers.info
|
||||||
/bin/sed -i /${usrvc}/d ${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
|
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]}"
|
echo -en "${idsCL[White]}${msg}${spc} : ${idsCL[Default]}"
|
||||||
@@ -954,7 +945,7 @@ UPDATESERVICE(){
|
|||||||
echo -e "${idsCL[Green]}${usrvc^} Service has been updated${idsCL[Default]}"
|
echo -e "${idsCL[Green]}${usrvc^} Service has been updated${idsCL[Default]}"
|
||||||
|
|
||||||
else
|
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
|
echo "$(date) - Updating Service (${usrvc}) : Update Not Needed" >> $logfile
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -966,7 +957,6 @@ UPDATESERVICE(){
|
|||||||
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
|
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
|
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]}"
|
echo -en "${idsCL[White]}${msg}${spc} : ${idsCL[Default]}"
|
||||||
installed_ver=`dpkg -s ${usrvc} | grep Version`
|
|
||||||
/usr/bin/apt install ${usrvc} >/dev/null 2>&1
|
/usr/bin/apt install ${usrvc} >/dev/null 2>&1
|
||||||
/bin/systemctl disable ${usrvc} >/dev/null 2>&1
|
/bin/systemctl disable ${usrvc} >/dev/null 2>&1
|
||||||
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
|
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
|
||||||
|
|||||||
Reference in New Issue
Block a user