From 863c12d97db614c1c16f686e16fde14d4e0ebe7c Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Mon, 28 Aug 2023 19:50:38 -0500 Subject: [PATCH] update --- linupx-scripts.sh | 5 +++-- run.sh | 18 ++++++++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/linupx-scripts.sh b/linupx-scripts.sh index 3f9ccf3..130a29e 100755 --- a/linupx-scripts.sh +++ b/linupx-scripts.sh @@ -3,7 +3,7 @@ action="$1" FOLDER='/opt/idssys/linupx' -VERS='6.48-08282023' +VERS='6.49-08282023' if [ -d /opt/idssys/settings ]; then [ $(ls /opt/idssys/settings | wc -l) -eq 0 ] && rm -rf /opt/idssys/settings @@ -667,7 +667,8 @@ COPYCERTS_UPDATE(){ /usr/bin/ssh-copy-id le@keepalived.scity.us # /bin/sed -i 's/le@keepalived.scity.us\:\/opt\/nginx-proxy\/ssl/le@keepalived.scity.us\:\/opt\/lb-data\/letsencrypt\/live/g' /opt/copycerts.sh /bin/sed -i 's/opt\/lb-data\/letsencrypt/etc\/letsencrypt/g' /opt/copycerts.sh - /opt/copycerts.sh + + crontab -l | grep '/opt/copycerts.sh' | grep -q -v '#' && /opt/copycerts.sh echo echo -e "${idsCL[Green]}copycerts.sh has been updated${idsCL[Default]}" diff --git a/run.sh b/run.sh index b3d387d..2709d8f 100755 --- a/run.sh +++ b/run.sh @@ -14,7 +14,11 @@ if curl -m 5 -s --head --request GET https://git.schroedercity.com | grep "HTTP if [ "${1}" != "runup" ]; then cd /opt/idssys/defaults - if [ "`git log --pretty=%H ...refs/heads/master^ | head -n 1`" != "`git ls-remote origin -h refs/heads/master |cut -f1`" ]; then + if [ "`git log --pretty=%H ...refs/heads/master^ | head -n 1`" != "`git ls-remote origin -h refs/heads/master |cut -f1`" ]; then + if [ "${1}" != "runup" ]; then + echo -en "\e[1A"; + echo -e "${idsCL[LightCyan]}Updating iDSSYS-Defaults...${idsCL[Default]}" + fi git fetch origin master >/dev/null 2>&1 git reset --hard origin/master >/dev/null 2>&1 git reflog expire --expire=now --all >/dev/null 2>&1 @@ -29,13 +33,23 @@ if curl -m 5 -s --head --request GET https://git.schroedercity.com | grep "HTTP cd /opt/idssys/linupx fi if [ "$1" != "update" ] && [ "$1" != "up" ]; then - if [ "`git log --pretty=%H ...refs/heads/master^ | head -n 1`" != "`git ls-remote origin -h refs/heads/master |cut -f1`" ]; then + if [ "`git log --pretty=%H ...refs/heads/master^ | head -n 1`" != "`git ls-remote origin -h refs/heads/master |cut -f1`" ]; then + if [ "${1}" != "runup" ]; then + echo -en "\e[1A"; + echo -e "\e[0K\r ${idsCL[LightCyan]}Updating LinUPx...${idsCL[Default]}" + fi git fetch origin master >/dev/null 2>&1 git reset --hard origin/master >/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 + + if [ "${1}" != "runup" ]; then + + echo -en "\e[1A"; + echo -e "\e[0K\r ${idsCL[Green]}Updated to v${VERS}${idsCL[Default]}" + fi fi fi if [ "${1}" != "runup" ]; then