update
This commit is contained in:
+4
-1
@@ -3,7 +3,10 @@
|
|||||||
|
|
||||||
action="$1"
|
action="$1"
|
||||||
FOLDER='/opt/idssys/ta-proxmenu'
|
FOLDER='/opt/idssys/ta-proxmenu'
|
||||||
VERS='2026.3.26-1'
|
VERS='2026.3.26-3'
|
||||||
|
|
||||||
|
noupdate=' restart cpu '
|
||||||
|
|
||||||
|
|
||||||
RNIP=$(ip addr show $(ip route | awk '/default/ { print $5 }') | grep "inet" | head -n 1 | awk '/inet/ {print $2}' | cut -d'/' -f1)
|
RNIP=$(ip addr show $(ip route | awk '/default/ { print $5 }') | grep "inet" | head -n 1 | awk '/inet/ {print $2}' | cut -d'/' -f1)
|
||||||
|
|
||||||
|
|||||||
@@ -5,60 +5,62 @@
|
|||||||
source /opt/idssys/defaults/default.inc
|
source /opt/idssys/defaults/default.inc
|
||||||
source /opt/idssys/ta-proxmenu/defaults.inc
|
source /opt/idssys/ta-proxmenu/defaults.inc
|
||||||
|
|
||||||
if curl -m 3 -s --head --request GET https://git.scity.us | grep "HTTP/2 200" > /dev/null; then
|
if [[ "${noupdate}" != *" ${1} "* ]] && [[ "${noupdate}" != *" ${2} "* ]]; then
|
||||||
if [ "${1}" != "tapm" ]; then
|
if curl -m 3 -s --head --request GET https://git.scity.us | grep "HTTP/2 200" > /dev/null; then
|
||||||
echo -en "${idsCL[LightCyan]}Checking for updates...${idsCL[Default]}"
|
if [ "${1}" != "tapm" ]; then
|
||||||
echo ""
|
echo -en "${idsCL[LightCyan]}Checking for updates...${idsCL[Default]}"
|
||||||
udtd=0
|
echo ""
|
||||||
fi
|
udtd=0
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "${1}" != "tapm" ]; then
|
if [ "${1}" != "tapm" ]; then
|
||||||
if [ ! -d /opt/idssys/defaults ]; then
|
if [ ! -d /opt/idssys/defaults ]; then
|
||||||
git clone https://git.scity.us/voltron/iDS-Defaults.git /opt/idssys/defaults
|
git clone https://git.scity.us/voltron/iDS-Defaults.git /opt/idssys/defaults
|
||||||
else
|
else
|
||||||
cd /opt/idssys/defaults
|
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}" != "tapm" ]; then
|
if [ "${1}" != "tapm" ]; then
|
||||||
echo -en "\e[1A";
|
echo -en "\e[1A";
|
||||||
echo -en "\e[0K\r${idsCL[LightCyan]}Updating iDSSYS-Defaults...${idsCL[Default]}"
|
echo -en "\e[0K\r${idsCL[LightCyan]}Updating iDSSYS-Defaults...${idsCL[Default]}"
|
||||||
udtd=1
|
udtd=1
|
||||||
fi
|
fi
|
||||||
git fetch origin master >/dev/null 2>&1
|
git fetch origin master >/dev/null 2>&1
|
||||||
git reset --hard 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 reflog expire --expire=now --all >/dev/null 2>&1
|
||||||
git repack -ad >/dev/null 2>&1
|
git repack -ad >/dev/null 2>&1
|
||||||
git prune >/dev/null 2>&1
|
git prune >/dev/null 2>&1
|
||||||
git pull >/dev/null 2>&1
|
git pull >/dev/null 2>&1
|
||||||
[ "${1}" != "tapm" ] && echo -e "${idsCL[Green]}Done${idsCL[Default]}"
|
[ "${1}" != "tapm" ] && echo -e "${idsCL[Green]}Done${idsCL[Default]}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd /opt/idssys/ta-proxmenu
|
cd /opt/idssys/ta-proxmenu
|
||||||
if [ "`git log --pretty=%H ...refs/heads/main^ | head -n 1`" != "`git ls-remote origin -h refs/heads/main |cut -f1`" ]; then
|
if [ "`git log --pretty=%H ...refs/heads/main^ | head -n 1`" != "`git ls-remote origin -h refs/heads/main |cut -f1`" ]; then
|
||||||
if [ "${1}" != "tapm" ]; then
|
if [ "${1}" != "tapm" ]; then
|
||||||
[ ${udtd} -eq 0 ] && echo -en "\e[1A";
|
[ ${udtd} -eq 0 ] && echo -en "\e[1A";
|
||||||
echo -en "\e[0K\r${idsCL[LightCyan]}Updating TA-Proxmenu...${idsCL[Default]}"
|
echo -en "\e[0K\r${idsCL[LightCyan]}Updating TA-Proxmenu...${idsCL[Default]}"
|
||||||
fi
|
fi
|
||||||
git fetch origin main >/dev/null 2>&1
|
git fetch origin main >/dev/null 2>&1
|
||||||
git reset --hard origin/main >/dev/null 2>&1
|
git reset --hard origin/main >/dev/null 2>&1
|
||||||
git reflog expire --expire=now --all >/dev/null 2>&1
|
git reflog expire --expire=now --all >/dev/null 2>&1
|
||||||
git repack -ad >/dev/null 2>&1
|
git repack -ad >/dev/null 2>&1
|
||||||
git prune >/dev/null 2>&1
|
git prune >/dev/null 2>&1
|
||||||
git pull >/dev/null 2>&1
|
git pull >/dev/null 2>&1
|
||||||
|
|
||||||
if [ "${1}" != "tapm" ]; then
|
if [ "${1}" != "tapm" ]; then
|
||||||
source /opt/idssys/ta-proxmenu/defaults.inc
|
source /opt/idssys/ta-proxmenu/defaults.inc
|
||||||
# echo -en "\e[1A";
|
# echo -en "\e[1A";
|
||||||
# echo -e "\e[0K\r ${idsCL[Green]}Updated to v${VERS}${idsCL[Default]}"
|
# echo -e "\e[0K\r ${idsCL[Green]}Updated to v${VERS}${idsCL[Default]}"
|
||||||
echo -e " ${idsCL[Green]}Updated to v${VERS}${idsCL[Default]}\n"
|
echo -e " ${idsCL[Green]}Updated to v${VERS}${idsCL[Default]}\n"
|
||||||
fi
|
fi
|
||||||
elif [ "${1}" != "tapm" ] && [ ${udtd} -eq 0 ]; then
|
elif [ "${1}" != "tapm" ] && [ ${udtd} -eq 0 ]; then
|
||||||
echo -e "\e[1A\e[0K\r ${idsCL[Green]}No updates available${idsCL[Default]}\n"
|
echo -e "\e[1A\e[0K\r ${idsCL[Green]}No updates available${idsCL[Default]}\n"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
echo -e "${idsCL[Red]}Could not connect to 'git.scity.us' for updates${idsCL[Default]}"
|
echo -e "${idsCL[Red]}Could not connect to 'git.scity.us' for updates${idsCL[Default]}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${1}" != "tapm" ] && [ "${1}" != "update" ] && [ "${1}" != "u" ]; then
|
if [ "${1}" != "tapm" ] && [ "${1}" != "update" ] && [ "${1}" != "u" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user