Update mm-scripts.sh

This commit is contained in:
2023-02-25 17:33:52 -06:00
parent 00a2463175
commit 93b3b1c714

View File

@@ -468,16 +468,19 @@ MMSTATUS(){
echo
}
MMUPDATE(){
MMUPDATECHECK(){
if curl -m 15 -s --head --request GET https://git.schroedercity.com | grep "HTTP/2 200" > /dev/null; then
cd ${MMFOLDER}
if [ "`git log --pretty=%H ...refs/heads/master^ | head -n 1`" != "`git ls-remote origin -h refs/heads/master |cut -f1`" ]; then
touch /opt
touch ${MMFOLDER}/update.available
fi
else
/bin/rm -f ${MMFOLDER}/update.available
fi
}
if [ ! -f ${MMFOLDER}/mm.update.stop ]; then
MMUPDATECHECK
if [ -f ${MMFOLDER}/mm.stop ]; then
stoppedsince=`date +%s`-$(stat -c %Y ${MMFOLDER}/mm.stop)
stopmsg="${idsCL[Yellow]}The system has currently been stopped for '$(SHOW_TIME ${stoppedsince})'.\n${idsCL[LightCyan]}(You'll need to run \"mm start\" to start services again)${idsCL[Default]}"