#!/bin/sh /etc/rc.common

START=21
STOP=89

USE_PROCD=1
NAME=loop-detector

start_service() {
	local enabled

	config_load loop_detection
	config_get_bool enabled loop enabled 1

	if [ $enabled -eq 1 ]; then
		procd_open_instance
		procd_set_param command "/sbin/loop-detector"
		procd_set_param respawn
		procd_close_instance
	fi
}

service_triggers()
{
	procd_add_reload_trigger loop_detection
}

reload_service() {
	stop
	start
}
