#!/bin/bash

. /usr/lib/eole/ihm.sh

Kernel=$(uname -sr)
tempfile=$(mktemp)

EchoGras "*** Paquets installés"

echo
echo -n "Noyau linux : $Kernel"
if command -v hwe-support-status > /dev/null
then
	echo -n " => "
	if LANG=C hwe-support-status --verbose | grep -qs 'is supported'
	then
		EchoVert "OK"
	else
		NEW_KERNEL=$(hwe-support-status --verbose \
				 | sed -n -e '/apt-get install/ s,.*\(linux-image-generic[^[:space:]]*\).*,\1,p')

		if [ -n "${NEW_KERNEL}" ]
		then
		    EchoRouge "non maintenu => $(EchoVert "installer ${NEW_KERNEL}")"
		else
		    EchoRouge "non maintenu => nouveau noyau installé, vous devez redémarrer"
		fi
	fi
else
	echo
fi
echo

if [ "$Verbose" != "yes" ]
then
	exit 0
fi

echo -n "Vérification des paquets installés : "
dpkg -C > $tempfile
if [ -s $tempfile ];then
	EchoRouge "Attention"
	cat $tempfile
else
	EchoVert "OK"
fi
echo
echo "Vérification des mises à jour..."
Query-Auto
echo
Pause

echo
echo  "Dernières actions Creole"
echo
tail -n20 /var/log/rsyslog/local/zephir/zephir.log
echo
Pause
