Update mm-scripts.sh

This commit is contained in:
2023-05-07 10:25:21 -05:00
parent d5e8d37fd9
commit bdf03daeab

View File

@@ -839,8 +839,8 @@ UPDATESERVICE(){
echo -en "${idsCL[White]}${msg}${spc} : ${idsCL[Default]}"
cd /var/www/media.scity.us/html >/dev/null 2>&1
if [ "`git log --pretty=%H ...refs/heads/v2-master^ | head -n 1`" != "`git ls-remote origin -h refs/heads/v2-master |cut -f1`" ] || [ "${2}" == "force" ]; then
[ "${2}" == "force" ] && echo -e "${idsCL[LightCyan]}Update Not Needed, forcing anyway${idsCL[Default]}" || echo -e "${idsCL[Green]}Update Available${idsCL[Default]}"
if [ "`git log --pretty=%H ...refs/heads/v2-master^ | head -n 1`" != "`git ls-remote origin -h refs/heads/v2-master |cut -f1`" ] || [ "${2}" == "-f" ]; then
[ "${2}" == "-f" ] && echo -e "${idsCL[LightCyan]}Update Not Needed, forcing anyway${idsCL[Default]}" || echo -e "${idsCL[Green]}Update Available${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]}"
/usr/bin/git stash >/dev/null 2>&1
@@ -877,8 +877,8 @@ UPDATESERVICE(){
latest_ver=`echo ${latest_release_url} | cut -d/ -f8`
cver=${usrvc}_VER
if [ "${!cver}" != "${latest_ver}" ] || [ "${2}" == "force" ]; then
[ "${2}" == "force" ] && echo -e "${idsCL[LightCyan]}Update Not Needed, forcing anyway${idsCL[Default]}" || echo -e "${idsCL[Green]}Update Available${idsCL[Default]}"
if [ "${!cver}" != "${latest_ver}" ] || [ "${2}" == "-f" ]; then
[ "${2}" == "-f" ] && echo -e "${idsCL[LightCyan]}Update Not Needed, forcing anyway${idsCL[Default]}" || echo -e "${idsCL[Green]}Update Available${idsCL[Default]}"
# rm -f ${MMFOLDER}/logs/update.${usrvc}
touch ${MMFOLDER}/logs/update.${usrvc}
@@ -930,7 +930,7 @@ UPDATESERVICE(){
echo -en "${idsCL[White]}${msg}${spc} : ${idsCL[Default]}"
[ "${usrvc}" == "qbittorrent" ] && ausrvc="qbittorrent-nox" || ausrvc=${usrvc}
if [ "$(apt-get -s upgrade | grep ${ausrvc})" != "" ] || [ "${2}" == "force" ]; then
if [ "$(apt-get -s upgrade | grep ${ausrvc})" != "" ] || [ "${2}" == "-f" ]; then
echo -e "${idsCL[Green]}Update Available${idsCL[Default]}"
SERVICEBACKUP ${usrvc}
@@ -1375,8 +1375,8 @@ USAGE(){
echo -e " ${idsCL[Yellow]}vpninfo ${idsCL[Default]}--> Show VPN Info"
echo -e " ${idsCL[Yellow]}speedtest ${idsCL[Default]}--> Run Speedtest Comparison (with and w/o VPN)"
echo
echo -e " ${idsCL[Yellow]}update-allservices ${idsCL[Default]}--> Update all services"
echo -e " ${idsCL[Yellow]}update-service <service> ${idsCL[Default]}--> Update specified service"
echo -e " ${idsCL[Yellow]}update-allservices ${idsCL[Default]}--> Update all services ( -f = force update)"
echo -e " ${idsCL[Yellow]}update-service <service> ${idsCL[Default]}--> Update specified service ( -f = force update)"
echo -e " ${idsCL[Yellow]}update-list ${idsCL[Default]}--> List available releases"
echo
echo -e " ${idsCL[Yellow]}cron ${idsCL[Default]}--> Crontab job for maintaining system (run */1 min)"