Update mm-scripts.sh
This commit is contained in:
@@ -832,14 +832,18 @@ 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
|
if [ "${usrvc}" == "organizr" ]; then
|
||||||
|
msg="Checking for update"; 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
|
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`" ]; then
|
if [ "`git log --pretty=%H ...refs/heads/v2-master^ | head -n 1`" != "`git ls-remote origin -h refs/heads/v2-master |cut -f1`" ]; then
|
||||||
msg="Updating Organizr Web UI Interface"; c=0; spc=''; spc1=$((${cw_spc}-${#msg})); until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
|
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
|
||||||
echo -en "${idsCL[White]}${msg}${spc} : ${idsCL[Default]}"
|
echo -en "${idsCL[White]}${msg}${spc} : ${idsCL[Default]}"
|
||||||
/usr/bin/git stash >/dev/null 2>&1
|
/usr/bin/git stash >/dev/null 2>&1
|
||||||
/usr/bin/git pull >/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/chown -Rf www-data:www-data /var/www/media.scity.us/html
|
||||||
echo -e "${idsCL[Green]}Updated${idsCL[Default]}"
|
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
|
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]}"
|
echo -en "${idsCL[White]}${msg}${spc} : ${idsCL[Default]}"
|
||||||
@@ -847,7 +851,7 @@ UPDATESERVICE(){
|
|||||||
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
|
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
|
||||||
echo "$(date) - Updating Service (${usrvc}) : Completed" >> $logfile
|
echo "$(date) - Updating Service (${usrvc}) : Completed" >> $logfile
|
||||||
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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user