This commit is contained in:
2023-04-29 16:43:17 -05:00
parent 94a1ce2a62
commit a95f7e1d66
2 changed files with 132 additions and 128 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
VERS='3.8.147-04232023' VERS='3.8.148-04232023'
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)

View File

@@ -814,11 +814,26 @@ UPDATESERVICE(){
echo -e "${idsCL[Green]}Updating ${usrvc^} Service${idsCL[Default]}" echo -e "${idsCL[Green]}Updating ${usrvc^} Service${idsCL[Default]}"
DIVIDER . lightGreen DIVIDER . lightGreen
if [ "${usrvc}" == "organizr" ]; then
msg="Updating Organizr"; 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]}"
cd /var/www/media.scity.us/html >/dev/null 2>&1
/usr/bin/git stash >/dev/null 2>&1
/usr/bin/git pull >/dev/null 2>&1
/bin/chown -Rf www-data:www-data /var/www/media.scity.us/html
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
msg="Restarting NGINX"; 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]}"
/bin/systemctl restart nginx >/dev/null 2>&1
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
echo "$(date) - Updated Organizr" >> $logfile
else
if [[ " ${UPDATE_SERVICES[*]} " =~ " ${usrvc} " ]]; then if [[ " ${UPDATE_SERVICES[*]} " =~ " ${usrvc} " ]]; then
msg="Stopping service and preparing" msg="Stopping service and preparing"; 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]}"
rm -f ${MMFOLDER}/logs/update.${usrvc} rm -f ${MMFOLDER}/logs/update.${usrvc}
@@ -937,6 +952,7 @@ UPDATESERVICE(){
echo -e "${idsCL[Red]}Not currently available to update${idsCL[Default]}" echo -e "${idsCL[Red]}Not currently available to update${idsCL[Default]}"
fi fi
fi
else else
echo -e "${idsCL[Red]}No service selected for update${idsCL[Default]}" echo -e "${idsCL[Red]}No service selected for update${idsCL[Default]}"
@@ -980,17 +996,6 @@ SHOWSRVCUPDATES(){
} }
UPDATEORGANIZR(){
echo -en "${idsCL[LightCyan]}Updating Organizr ... ${idsCL[Default]}"
cd /var/www/media.scity.us/html >/dev/null 2>&1
/usr/bin/git stash >/dev/null 2>&1
/usr/bin/git pull >/dev/null 2>&1
/bin/chown -Rf www-data:www-data /var/www/media.scity.us/html
/bin/systemctl restart nginx >/dev/null 2>&1
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
echo "$(date) - Updated Organizr" >> $logfile
}
MMSETUP(){ MMSETUP(){
echo -e "${idsCL[Green]}Media Manager Setup Scripts${idsCL[Default]}" echo -e "${idsCL[Green]}Media Manager Setup Scripts${idsCL[Default]}"
echo echo
@@ -1399,7 +1404,6 @@ if [ ! -f ${MMFOLDER}/mm.update.stop ]; then
done done
;; ;;
update-list) SHOWSRVCUPDATES;; update-list) SHOWSRVCUPDATES;;
update-organizr) UPDATEORGANIZR;;
clear) echo -e "${idsCL[LightCyan]}Clearing all mm.* files ${idsCL[Default]}"; echo;; clear) echo -e "${idsCL[LightCyan]}Clearing all mm.* files ${idsCL[Default]}"; echo;;
*) USAGE;; *) USAGE;;