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 #
##---------------##
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")
DomoChk=/opt/backups/timestamps/Domoticz.update
NodeChk=/opt/backups/timestamps/NodeRED.update
@ -133,9 +141,9 @@ else
REBOOT=yes
echo "Updated on: $DATE" > /opt/backups/timestamps/OS.update
sleep 3
apt update
apt upgrade -y
apt autoremove -y
$PKGUD
$PKGUP
$PKARM
fi
fi
@ -159,37 +167,3 @@ TERM=ansi whiptail --title "Updater" --infobox "Thank you for using the updater
sleep 5
clear
exit
##-----------##
# Updater #
##-----------##
if [[ $Domoticz == *"yes"* ]]; then
fi
if [[ $NodeRED == *"yes"* ]]; then
fi
if [[ $Zigbee2MQTT == *"yes"* ]]; then
fi