general-UPDATE-NOTIFIER

Version general-Update-Notifier for all apt package-managements

general-UPDATE-NOTIFIER

…. Make a /opt/UPDATE folder

sudo mkdir -p /opt/UPDATE

….. Copy files b.txt PHASE2 update-check to /opt/UPDATE

sudo cp b.txt PHASE2 UPDATE update-check /opt/UPDATE

….. Add update check to root crontab like

sudo crontab -e

… add a line

@reboot cd /opt/UPDATE && sleep 60 && ./update-check

…. for User crontab

crontab -e

… add a line

@reboot cd /opt/UPDATE && sleep 180 && ./PHASE2

….. If there has no updates, nothing appears, but if there has updates PHASE2 launches update process.

…. for permissions

sudo chown $USER:root /opt/UPDATE/UPDATE

##########################################################

Files:

b.txt

apt list

PHASE2

#!/bin/bash
# RJP 16.6.2023
A=$(grep -o 'apt list' /tmp/a.txt)
B=$(grep -o 'apt list' /tmp/b.txt)
if [ "$A" = "$B" ]
then
cd /opt/UPDATE && ./UPDATE
else
sleep 5
fi

UPDATE

#!/bin/bash
#
# RJP 16.6.2023
#
#!/bin/bash
LIST=$(apt-get --simulate upgrade)
#
export DISPLAY=:0.0
echo "$LIST" | yad --list --title "Search Results" --width=1000 --height=500 --text "INFORMATION" --column "AVAILABLE UPDATES" --button=gtk-ok:1
yad --text="Would you like to install updates?" --title="UPDATER"
if [ $? = 0 ];
then
x-terminal-emulator -e /bin/bash -c "sudo apt update && sudo apt upgrade && yad --center --borders=5 --width=400 --text-align=center --button=gtk-ok:1 --title='Update Complete' --buttons-layout=center"
else exit 0
fi

update-check

#!/bin/bash
## RJP 16.6.2023
## check updates every 600 minutes
for (( ; ; ))
do
cp /opt/UPDATE/b.txt /tmp
chmod 644 /tmp/b.txt
apt update > /tmp/a.txt
chmod 644 /tmp/a.txt
sleep 36000
done