lib/specinfra/command/base.rb in specinfra-1.2.0 vs lib/specinfra/command/base.rb in specinfra-1.2.1
- old
+ new
@@ -188,12 +188,12 @@
end
def check_cron_entry(user, entry)
entry_escaped = entry.gsub(/\*/, '\\*')
if user.nil?
- "crontab -l | grep -- #{escape(entry_escaped)}"
+ "crontab -l | grep -v \"#\" -- | grep -- #{escape(entry_escaped)}"
else
- "crontab -u #{escape(user)} -l | grep -- #{escape(entry_escaped)}"
+ "crontab -u #{escape(user)} -l | grep -v \"#\" | grep -- #{escape(entry_escaped)}"
end
end
def check_link(link, target)
"stat -c %N #{escape(link)} | egrep -e \"-> .#{escape(target)}.\""