Update Installer.sh

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

View File

@ -4,15 +4,29 @@
# Static Vars # # Static Vars #
##---------------## ##---------------##
OUTPUT='>/dev/null 2>&1' OUTPUT='/dev/null'
APTMODE="debconf-apt-progress -- apt" APTMODE="debconf-apt-progress -- apt"
DATE=$(date +"%m-%d-%Y") 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")
IP=`hostname -I` IP=`hostname -I`
IP=$(echo $IP | tr -d ' ') IP=$(echo $IP | tr -d ' ')
REPO=PiAutomation REPO=PiAutomation
GIT=https://raw.githubusercontent.com/Beeranco GIT=https://raw.githubusercontent.com/Beeranco
BRANCH=main BRANCH=main
##---------------##
# Dependencies #
##---------------##
$PKGI curl wget whiptail
##-----------## ##-----------##
# Check OS # # Check OS #
##-----------## ##-----------##
@ -152,12 +166,12 @@ fi
# Updater # # Updater #
##-----------## ##-----------##
apt update $PKGUD
apt remove --purge manpages* p7zip* vim* pigz* strace* rng-tools* manpages* triggerhappy* -y $PKRM manpages* p7zip* vim* pigz* strace* rng-tools* manpages* triggerhappy*
apt list --upgradeable 2>/dev/null | cut -d/ -f1 | grep -v Listing >> /tmp/install.list apt list --upgradeable 2>/dev/null | cut -d/ -f1 | grep -v Listing >> /tmp/install.list
echo "unattended-upgrades" /tmp/install.list echo "unattended-upgrades" /tmp/install.list
xargs < /tmp/install.list apt-get install -y xargs < /tmp/install.list xargs $PKGI
apt autoremove -y $PKARM
##-------------## ##-------------##