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

START=99
STOP=99
USE_PROCD=1

start_service() {
	readonly need_xdsl="$(jsonfilter -i /etc/board.json -e @.dsl)"
	[ -f /etc/board.json ] || return 0

	if [ "$need_xdsl" != "" ]; then
		procd_open_instance xdsl_wan
		procd_set_param command /sbin/xdsl_wan
		procd_set_param respawn
		procd_close_instance
	fi
}

boot() {
	: # boot-up is handled from 'hsm' application
}

service_triggers()
{
	procd_add_reload_trigger "dsl"
}
