forked from ungleich-public/cdist
bugfix in __cron type, was a wrong quoting
This commit is contained in:
parent
7d46156fd6
commit
c50925cab5
2 changed files with 3 additions and 3 deletions
0
cdist/conf/type/__cron/explorer/entry
Executable file → Normal file
0
cdist/conf/type/__cron/explorer/entry
Executable file → Normal file
6
cdist/conf/type/__cron/gencode-remote
Normal file → Executable file
6
cdist/conf/type/__cron/gencode-remote
Normal file → Executable file
|
@ -60,7 +60,7 @@ prefix="#cdist:__cron/$__object_id"
|
||||||
suffix="#/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"
|
||||||
cat << DONE
|
cat << DONE
|
||||||
crontab -u $user -l | grep -v -E "$filter" | awk -v prefix="$prefix" -v suffix="$suffix" '
|
crontab -u $user -l 2>/dev/null | grep -v -E "$filter" | awk -v prefix="$prefix" -v suffix="$suffix" '
|
||||||
{
|
{
|
||||||
if (index(\$0,prefix)) {
|
if (index(\$0,prefix)) {
|
||||||
triggered=1
|
triggered=1
|
||||||
|
@ -79,12 +79,12 @@ DONE
|
||||||
case "$state_should" in
|
case "$state_should" in
|
||||||
present)
|
present)
|
||||||
echo "("
|
echo "("
|
||||||
echo "crontab -u $user -l | grep -v -E "$filter" 2>/dev/null || true"
|
echo "crontab -u $user -l 2>/dev/null | grep -v -E \"$filter\" 2>/dev/null || true"
|
||||||
echo "echo '$entry'"
|
echo "echo '$entry'"
|
||||||
echo ") | crontab -u $user -"
|
echo ") | crontab -u $user -"
|
||||||
;;
|
;;
|
||||||
absent)
|
absent)
|
||||||
echo "( crontab -u $user -l | grep -v -E "$filter" 2>/dev/null || true ) | \\"
|
echo "( crontab -u $user -l 2>/dev/null | grep -v -E \"$filter\" 2>/dev/null || true ) | \\"
|
||||||
echo "grep -v \"# $name\\$\" | crontab -u $user -"
|
echo "grep -v \"# $name\\$\" | crontab -u $user -"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in a new issue