From 09e5c697deec85a1497dd3b8ea8d87505e5e7e21 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sun, 14 Dec 2025 17:32:46 -0600 Subject: [PATCH] initial upload --- defaults.inc | 7 +++++ proxmenu-scripts.sh | 64 ++++++++++++++++++++++++++++++++++++++++ run.sh | 71 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 142 insertions(+) create mode 100755 defaults.inc create mode 100755 proxmenu-scripts.sh create mode 100755 run.sh diff --git a/defaults.inc b/defaults.inc new file mode 100755 index 0000000..b03abed --- /dev/null +++ b/defaults.inc @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +action="$1" +FOLDER='/opt/idssys/ta-proxmenu' +VERS='0.1-12142025' + + diff --git a/proxmenu-scripts.sh b/proxmenu-scripts.sh new file mode 100755 index 0000000..42ab8bf --- /dev/null +++ b/proxmenu-scripts.sh @@ -0,0 +1,64 @@ +#!/usr/bin/env bash +# TA-ProxMenu - Proxmox Scripts + + +[ "${2}" != "q" ] && source /opt/idssys/defaults/colors.inc +source /opt/idssys/defaults/default.inc +source /opt/idssys/linupx/settings.conf +source /opt/idssys/linupx/defaults.inc + + + + + + +MAIN_MENU() { + if [ -f ${FOLDER}/lastrun ]; then + LASTRUND=$(stat -c %y ${FOLDER}/lastrun | cut -d ' ' -f1) + LASTRUNT=$(stat -c %y ${FOLDER}/lastrun | cut -d ' ' -f2 | cut -d '.' -f1) + else + LASTRUND='never' + LASTRUNT='' + fi + while : + do + clear + echo + echo -e " ${idsCL[Green]}TA-ProxMenu - Proxmox Scripts${idsCL[Default]} ${idsCL[White]}(ver-${VERS})${idsCL[Default]}" + echo -e "${idsCL[Green]}---------------------------------------------------------------------------${idsCL[Default]}" + echo -e "Hostname: ${idsCL[Cyan]}$(hostname -s)${idsCL[Default]}" + echo + echo -e "---------------------------------------------------------------------------" + echo + + echo -e " [${idsCL[Yellow]}Q${idsCL[Default]}] Quit" + echo + echo + echo -e -n "${idsCL[Yellow]}Please select an [ActionItem] from above:${idsCL[Default]} " + read -n 1 opt + echo + case $opt in + + [Qq]) + EXIT1 + exit 0;; + *) echo "Thats an invaild option,"; + echo "please select a valid option only."; + sleep 1;; + esac + done +} + + +if [ ${1-x} ]; then + case $1 in + update) UPDATE;; + + esac +else + MAIN_MENU +fi + +exit 0 + + diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..496d519 --- /dev/null +++ b/run.sh @@ -0,0 +1,71 @@ +#!/usr/bin/env bash +# UbUpdate - Ubuntu Update Scripts Loader + +[ "${2}" != "q" ] && source /opt/idssys/defaults/colors.inc +source /opt/idssys/defaults/default.inc +source /opt/idssys/ta-proxmenu/settings.conf +source /opt/idssys/ta-proxmenu/defaults.inc + +if curl -m 3 -s --head --request GET https://git.schroedercity.com | grep "HTTP/2 200" > /dev/null; then + if [ "${1}" != "runup" ]; then + echo -en "${idsCL[LightCyan]}Checking for updates...${idsCL[Default]}" + echo "" + udtd=0 + fi + + if [ "${1}" != "runup" ]; then + if [ ! -d /opt/idssys/defaults ]; then + git clone https://git.schroedercity.com/voltron/iDS-Defaults.git /opt/idssys/defaults + else + 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 [ "${1}" != "runup" ]; then + echo -en "\e[1A"; + echo -en "\e[0K\r${idsCL[LightCyan]}Updating iDSSYS-Defaults...${idsCL[Default]}" + udtd=1 + 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 + [ "${1}" != "runup" ] && echo -e "${idsCL[Green]}Done${idsCL[Default]}" + fi + fi + fi + + cd /opt/idssys/ta-proxmenu + 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 + [ ${udtd} -eq 0 ] && echo -en "\e[1A"; + echo -en "\e[0K\r${idsCL[LightCyan]}Updating TA-ta-proxmenu...${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 + source /opt/idssys/ta-proxmenu/defaults.inc + # echo -en "\e[1A"; + # echo -e "\e[0K\r ${idsCL[Green]}Updated to v${VERS}${idsCL[Default]}" + echo -e " ${idsCL[Green]}Updated to v${VERS}${idsCL[Default]}" + fi + elif [ "${1}" != "runup" ] && [ ${udtd} -eq 0 ]; then + echo -e "\e[1A\e[0K\r ${idsCL[Green]}No updates available${idsCL[Default]}" + echo "" + fi + +else + echo -e "${idsCL[Red]}Could not connect to 'git.schroedercity.com' for updates${idsCL[Default]}" +fi + +if [ "${1}" != "runup" ] && [ "${1}" != "update" ] && [ "${1}" != "u" ]; then + /opt/idssys/ta-proxmenu/proxmenu-scripts.sh $1 $2 $3 $4 +fi + +exit 0 +