diff --git a/debian/lubuntu-update-notifier.postinst b/debian/lubuntu-update-notifier.postinst new file mode 100644 index 0000000..0c22f98 --- /dev/null +++ b/debian/lubuntu-update-notifier.postinst @@ -0,0 +1,12 @@ +#!/bin/sh + +set -e + +# This file can be removed following the release of Lubuntu 24.04 LTS +# It's to ensure a smooth transition between the autostart file and the new +# systemd user units provided + +rm -f /etc/xdg/autostart/upg-notifier-autostart.desktop +rm -f /home/*/.config/autostart/upg-notifier-autostart.desktop + +#DEBHELPER# diff --git a/lubuntu-upg-notifier.sh b/lubuntu-upg-notifier.sh index 10b1223..853709e 100755 --- a/lubuntu-upg-notifier.sh +++ b/lubuntu-upg-notifier.sh @@ -16,27 +16,25 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -while true; - do - OUT=`/usr/lib/update-notifier/apt-check 2>&1` - oldIFS=$IFS - IFS=';' - j=0 - for STRING in $OUT; do - case $j in - 0) - UPG=$STRING;; - 1) - SEC=$STRING;; - esac - j=`expr $j + 1` - done - IFS=$oldIFS +OUT=`/usr/lib/update-notifier/apt-check 2>&1` +oldIFS=$IFS +IFS=';' +j=0 +for STRING in $OUT; do + case $j in + 0) + UPG=$STRING;; + 1) + SEC=$STRING;; + esac + j=`expr $j + 1` +done +IFS=$oldIFS - NEWREL_CHECK=`/usr/bin/do-release-upgrade -c 2>&1` - NEWREL=$? - if [ "$NEWREL" -eq 0 ]; then - VERSION=`echo $NEWREL_CHECK | awk -F\' '/available/{print $2}'` - fi - /usr/libexec/lubuntu-update-notifier/lubuntu-notifier.py -u $UPG -s $SEC -r $NEWREL -v $VERSION -p /usr/bin/lubuntu-upgrader -done; +NEWREL_CHECK=`/usr/bin/do-release-upgrade -c 2>&1` +NEWREL=$? +if [ "$NEWREL" -eq 0 ]; then + VERSION=`echo $NEWREL_CHECK | awk -F\' '/available/{print $2}'` +fi + +/usr/libexec/lubuntu-update-notifier/lubuntu-notifier.py -u $UPG -s $SEC -r $NEWREL -v $VERSION -p /usr/bin/lubuntu-upgrader