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

START=30
USE_PROCD=1

#validate_chargingpointd_section() {
#}

#chargingpointd_config() {
#}

reload_service() {
	config_load chargingpointd
}

service_triggers()
{
	procd_add_reload_trigger "chargingpointd"
}

start_service() {
	#update client
	. /lib/functions/client.sh
	
	client=$(client)
	uci set ingeteam.@ingeteam[0].customer=$client
	uci commit ingeteam

	procd_open_instance
	procd_set_param command /usr/sbin/chargingpointd

	#respawn automatically if something died, be careful
	procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-2} ${respawn_retry:-0}
	#reload
	procd_set_param file /etc/config/chargingpointd
	#log printfs
	procd_set_param stdout 1
	procd_set_param stderr 1
	procd_set_param user root

	procd_close_instance
}

#stop_service() {
#}

