forked from ungleich-public/cdist
__cron should replace entrys with his id, try 2
This commit is contained in:
parent
6afc4b82c2
commit
5a114cf6ae
2 changed files with 3 additions and 2 deletions
|
@ -22,4 +22,4 @@
|
|||
name="$__object_name"
|
||||
user="$(cat "$__object/parameter/user")"
|
||||
|
||||
crontab -u $user -l 2>/dev/null | grep "# $name\$" | head -n 1 || true
|
||||
crontab -u $user -l 2>/dev/null | grep "# $name\$" || true
|
||||
|
|
|
@ -78,8 +78,9 @@ DONE
|
|||
|
||||
case "$state_should" in
|
||||
present)
|
||||
# if we insert new entry, filter also all entrys out with the same id
|
||||
echo "("
|
||||
echo "crontab -u $user -l 2>/dev/null | grep -v -E \"$filter\" 2>/dev/null || true"
|
||||
echo "crontab -u $user -l 2>/dev/null | grep -v -E \"$filter\" | grep -v \"# $name\\$\" 2>/dev/null || true"
|
||||
echo "echo '$entry'"
|
||||
echo ") | crontab -u $user -"
|
||||
;;
|
||||
|
|
Loading…
Reference in a new issue