Update mm-scripts.sh

This commit is contained in:
2023-04-23 21:13:50 -05:00
parent 8490b555ff
commit 9ca2e99390

View File

@@ -812,6 +812,7 @@ 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]}"
echo -e "${idsCL[LightCyan]}${beta}Download URL: ${idsCL[LightGreen]}${latest_release_url}${idsCL[Default]}"
@@ -853,13 +854,17 @@ UPDATESERVICE(){
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]}"
fi
[ ! -f ${MMFOLDER}/vers.info ] && touch ${MMFOLDER}/vers.info
sed -i '/${usrvc}_VER/d' ${MMFOLDER}/vers.info
echo "${usrvc}_VER=\"${installed_ver}\"" >> ${MMFOLDER}/vers.info
msg="Starting service back up"
c=0; spc=''; spc1=$((${cw_spc}-${#msg}))
@@ -868,6 +873,7 @@ UPDATESERVICE(){
OUT=$(ip link | grep "$VPN_INTERFACE") >/dev/null 2>&1
if [ ${#OUT} -ne 0 ] && [ ! -f ${MMFOLDER}/mm.stop ] && [ ! -f ${MMFOLDER}/mm.noservices ] && [[ " ${SERVICES_CHECK[*]} " =~ " ${usrvc} " ]]; then
/bin/systemctl disable ${usrvc} >> ${MMFOLDER}/logs/update.${usrvc}
/bin/systemctl start ${usrvc} >> ${MMFOLDER}/logs/update.${usrvc}
[ "${usrvc}" == "radarr" ] && [[ " ${SERVICES_CHECK[*]} " =~ " radarr3d " ]] && /bin/systemctl start radarr3d >> ${MMFOLDER}/logs/update.${usrvc}
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
@@ -1251,7 +1257,7 @@ USAGE(){
echo -e " ${idsCL[Yellow]}check ${idsCL[Default]}--> Crontab job for maintaining system (run */1 min)"
echo -e " ${idsCL[Yellow]}clear ${idsCL[Default]}--> Clear all tmp files"
echo -e " ${idsCL[Yellow]}update ${idsCL[Default]}--> Check for and install new updates"
echo -e " ${idsCL[Yellow]}setup ${idsCL[Default]}--> Setup/Reconfigure Settings"
echo -e " ${idsCL[Yellow]}setup ${idsCL[Default]}--> Setup/Reconfigure Settings (Network/MM Config/SSHFS Mount)"
echo ""
echo ""
}