Merge pull request #511 from dheule/cron_fix

fix filter for new cron on sles12 sp2
This commit is contained in:
Darko Poljak 2017-01-13 21:45:53 +01:00 committed by GitHub
commit 8c817bc1ca

View file

@ -3,6 +3,7 @@
# 2011 Steven Armstrong (steven-cdist at armstrong.cc)
# 2013 Nico Schottelius (nico-cdist at schottelius.org)
# 2013 Thomas Oettli (otho at sfs.biz)
# 2017 Daniel Heule (hda at sfs.biz)
#
# This file is part of cdist.
#
@ -57,7 +58,7 @@ state_should="$(cat "$__object/parameter/state" 2>/dev/null || echo "present")"
# These are the old markers
prefix="#cdist:__cron/$__object_id"
suffix="#/cdist:__cron/$__object_id"
filter="^# DO NOT EDIT THIS FILE|^# \(.* installed on |^# \(Cron version V"
filter="^# DO NOT EDIT THIS FILE|^# \(.* installed on |^# \(Cron version V|^# \(Cronie version .\..\)$"
cat << DONE
crontab -u $user -l 2>/dev/null | grep -v -E "$filter" | awk -v prefix="$prefix" -v suffix="$suffix" '
{