pkgkernel/notify.sh

16 lines
517 B
Bash
Raw Normal View History

2019-06-25 10:36:41 +02:00
#! /bin/bash
# Get icon
2020-06-01 14:19:11 +02:00
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
ICON=${SCRIPTPATH}/tux.png
2019-06-25 10:36:41 +02:00
# Get installed kernel version
CURRENT=`uname -r|cut -d'-' -f 1`
# Get last available stable version
INFO=`curl -Ls https://www.kernel.org/ | perl -lne 'BEGIN{$/=""} print "$1 $2" if \
/latest_link.*?<a.*?href=\"(.*?)\".*?>(.*?)</s'`
LASTVERSION=`echo ${INFO} | cut -d' ' -f 2`
2020-06-01 14:19:11 +02:00
if [ "${CURRENT}" != "${LASTVERSION}" ] ; then
notify-send -i ${ICON} "Kernel update" "New version available (${LASTVERSION})"
2019-06-25 10:36:41 +02:00
fi