# Calculate chmod=755 path=/var/calculate/bin
#!/bin/bash
# The daemon restarts the services that have crashed.
# List the tracked services in /etc/conf.d/check-crashed

RC_MONITOR_RESTART=$@;

while true; do
	for svc in $(rc-status --crashed) ; do
		for chk in $RC_MONITOR_RESTART ; do
			if [ "$chk" = "$svc" ] ; then
				rc-service $svc -- --nodeps restart
				continue 2
			fi
	    	done
	done
	sleep 1
done
