Update Updater.sh

Fixed $DATE formatting
Added progress UI for APT
This commit is contained in:
Beeranco 2023-08-13 15:52:04 +02:00 committed by GitHub
parent 08a440b1d4
commit 571c7da064
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,7 +13,15 @@
# Static Vars # # Static Vars #
##---------------## ##---------------##
DATE=$(date +"%m-%d-%Y") OUTPUT='/dev/null'
APTMODE="debconf-apt-progress -- apt"
PKGM="$APTMODE"
PKGUD="$PKGM update"
PKGUP="$PKGM upgrade -y"
PKGI="${PKGM} install -y"
PKRM="$PKGM remove --purge -y"
PKARM="$PKGM autoremove -y"
DATE=$(date "+%d-%m-%Y")
NAME=$(<"/etc/username") NAME=$(<"/etc/username")
DomoChk=/opt/backups/timestamps/Domoticz.update DomoChk=/opt/backups/timestamps/Domoticz.update
NodeChk=/opt/backups/timestamps/NodeRED.update NodeChk=/opt/backups/timestamps/NodeRED.update
@ -133,9 +141,9 @@ else
REBOOT=yes REBOOT=yes
echo "Updated on: $DATE" > /opt/backups/timestamps/OS.update echo "Updated on: $DATE" > /opt/backups/timestamps/OS.update
sleep 3 sleep 3
apt update $PKGUD
apt upgrade -y $PKGUP
apt autoremove -y $PKARM
fi fi
fi fi
@ -159,37 +167,3 @@ TERM=ansi whiptail --title "Updater" --infobox "Thank you for using the updater
sleep 5 sleep 5
clear clear
exit exit
##-----------##
# Updater #
##-----------##
if [[ $Domoticz == *"yes"* ]]; then
fi
if [[ $NodeRED == *"yes"* ]]; then
fi
if [[ $Zigbee2MQTT == *"yes"* ]]; then
fi