initial upload
This commit is contained in:
7
defaults.inc
Executable file
7
defaults.inc
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
action="$1"
|
||||
FOLDER='/opt/idssys/ta-proxmenu'
|
||||
VERS='0.1-12142025'
|
||||
|
||||
|
||||
64
proxmenu-scripts.sh
Executable file
64
proxmenu-scripts.sh
Executable file
@@ -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
|
||||
|
||||
|
||||
71
run.sh
Executable file
71
run.sh
Executable file
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user