groups:
	cfclient		= ( "/bin/ping -c 1 cfservd" )

editfiles:
	cfclient::
		# Activate cfservd if there is a cfengine server on the net
		{ /etc/default/cfengine2

		BeginGroupIfNoMatch "RUN_CFSERVD=1"
			LocateLineMatching "RUN_CFSERVD=0"
			ReplaceLineWith "RUN_CFSERVD=1"
		EndGroup
		}
	
		# Run cfengine on reboot
		# (to make sure that clients that are offline a lot, get their "fix", too
		{ /etc/cron.d/cfengine
		AutoCreate
		AppendIfNoSuchLine "@reboot    root   /usr/sbin/cfagent -f update.conf && /usr/sbin/cfagent -f cfagent.conf"
		}

shellcommands:
	cfclient::
		"/etc/init.d/cfengine restart"
