lib/specinfra/command/base.rb in specinfra-1.18.0 vs lib/specinfra/command/base.rb in specinfra-1.18.1

- old
+ new

@@ -198,10 +198,10 @@ regexp = "^#{group}$" "stat -c %G #{escape(file)} | grep -- #{escape(regexp)}" end def check_cron_entry(user, entry) - entry_escaped = entry.gsub(/\*/, '\\*') + entry_escaped = entry.gsub(/\*/, '\\*').gsub(/\[/, '\\[').gsub(/\]/, '\\]') if user.nil? "crontab -l | grep -v \"#\" -- | grep -- #{escape(entry_escaped)}" else "crontab -u #{escape(user)} -l | grep -v \"#\" | grep -- #{escape(entry_escaped)}" end