changeset 378:d539c21143bb

Get more specific with extracting Yum update list The regex would still return some additional values or blank lines. The new regex has been checked against both "yum check-update" and "yum list" and matches all currently installed version strings (including weird Git ones)
author IBBoard <dev@ibboard.co.uk>
date Wed, 29 Sep 2021 20:25:44 +0100
parents 18765f598232
children 63adae1a374a
files manifests/templates.pp
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/manifests/templates.pp	Sat Sep 25 16:05:55 2021 +0100
+++ b/manifests/templates.pp	Wed Sep 29 20:25:44 2021 +0100
@@ -840,7 +840,7 @@
 	}
 	# Notify of available updates
 	cron { 'check-yum-updates':
-		command => '/usr/bin/yum check-update | tail -n +2 | grep -Ev "^ \* [[:alnum:]-]+: [[:alnum:]\.]+$"',
+		command => '/usr/bin/yum check-update | grep -E "^[^ ]+ +[0-9a-z_\.-]+ +[^ ]+$"',
 		hour => '4',
 		minute => '30',
 		weekday => '0-6/3', #Sunday, Wednesday and Saturday morning