This commit is contained in:
2023-05-02 18:22:37 -05:00
parent f0be95e5d5
commit e0994bc120
2 changed files with 15 additions and 21 deletions

18
run.sh
View File

@@ -4,6 +4,9 @@
source /opt/idssys/defaults/colors.inc
source /opt/idssys/defaults/default.inc
source /opt/idssys/mediamanager/defaults.inc
source ${MMFOLDER}/settings.conf
[ "${GITBRANCH}" != "" ] && GBRANCH="${GITBRANCH}" || GBRANCH="master"
if [ "${2}" == "q" ]; then
unset idsCL idsBG idsST
@@ -13,12 +16,6 @@ if [ "${2}" == "q" ]; then
[ "${1}" == "update" ] && echo -e "\n\n$(date) - Starting log #############################\n" >> ${outputlogfile}
fi
if [ -f /opt/idssys/settings/mediamanager.conf ]; then
source /opt/idssys/settings/mediamanager.conf
else
source ${MMFOLDER}/settings.conf
fi
if ([ "${1}" == "check" ] && [ "$(date +%M)" == "15" ]) || [ "${1}" == "" ]; then
MMUPDATECHECK
fi
@@ -47,23 +44,22 @@ if [ "${1}" == "update" ] || [ "${1}" == "setup" ]; then
fi
cd ${MMFOLDER}
[ "${GITBRANCH}" != "" ] && gb="${GITBRANCH}" || gb="master"
if [ "`git log --pretty=%H ...refs/heads/${gb}^ | head -n 1`" != "`git ls-remote origin -h refs/heads/${gb} |cut -f1`" ]; then
if [ "`git log --pretty=%H ...refs/heads/${GBRANCH}^ | head -n 1`" != "`git ls-remote origin -h refs/heads/${GBRANCH} |cut -f1`" ]; then
if [ "${2}" != "q" ]; then
echo -en "\e[1A";
echo -e "\e[0K\r ${idsCL[LightCyan]}Installing mediamanager updates...${idsCL[Default]}"
else
echo -e "${idsCL[LightCyan]}Installing mediamanager updates...${idsCL[Default]}"
fi
git fetch origin ${gb} >/dev/null 2>&1
git reset --hard origin/${gb} >/dev/null 2>&1
git fetch origin ${GBRANCH} >/dev/null 2>&1
git reset --hard origin/${GBRANCH} >/dev/null 2>&1
git reflog expire --expire=now --all >/dev/null 2>&1
git repack -ad >/dev/null 2>&1
git prune >/dev/null 2>&1
git pull >/dev/null 2>&1
git submodule update --remote >/dev/null 2>&1
/bin/chmod +x ${MMFOLDER}/mm-scripts.sh 2>&1
source /opt/idssys/mediamanager/defaults.inc
source ${MMFOLDER}/defaults.inc
if [ "${2}" != "q" ]; then
echo -en "\e[1A";
echo -e "\e[0K\r ${idsCL[Green]}Update to v${VERS} complete${idsCL[Default]}"