In regard to: [Puppet Users] Re: hasstatus not working as expected, Chad...:
status) /sbin/iptables -L | /bin/egrep '^DROP+\s+all.*NEW\s?+$' > /dev/ null
I doubt this is the actual problem, but you could more portably and more correctly write that regex as '^DROP[[:space:]]+all.*NEW[[:space:]]*$' You don't need the "+" after the P, since you don't want to match things like DROPPPPP, and you don't need the ? or the + after NEW, since you're anchoring the end and there's therefore really no reason to use non-greedy matching. Your comment also mentions "any amount of whitespace", which presumably includes 0 matches, hence the * instead of the +. Also, you should probably run (as you) env grep -i grep and see if something like GREP_OPTIONS is in your environment.
# A string has to start with "DROP" then whitespace, then "all", then anything, then NEW, then any amount of whitespace # For some reason iptables -L has a whitespace after NEW if [ "$?" = "0" ]; then echo "iptables is running" exit 0 else echo "iptables is stopped" exit 3 fi ;; **********
Tim -- Tim Mooney moo...@dogbert.cc.ndsu.nodak.edu Enterprise Computing & Infrastructure 701-231-1076 (Voice) Room 242-J6, IACC Building 701-231-8541 (Fax) North Dakota State University, Fargo, ND 58105-5164 -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.