#!/bin/sh

set_tr143_diagnostic_defaults() {
	if [ ! -f /etc/bbfdm/dmmap/dmmap_diagnostics ]; then
		touch /etc/bbfdm/dmmap/dmmap_diagnostics
	fi

	uci -q -c /etc/bbfdm/dmmap set dmmap_diagnostics.download='download'
	uci -q -c /etc/bbfdm/dmmap set dmmap_diagnostics.download.DefaultNumberOfConnections='1'
	uci -q -c /etc/bbfdm/dmmap set dmmap_diagnostics.download.DownloadDiagnosticMaxConnections='1'

	uci -q -c /etc/bbfdm/dmmap set dmmap_diagnostics.upload='upload'
	uci -q -c /etc/bbfdm/dmmap set dmmap_diagnostics.upload.DefaultNumberOfConnections='1'
	uci -q -c /etc/bbfdm/dmmap set dmmap_diagnostics.upload.UploadDiagnosticMaxConnections='1'

	uci -q -c /etc/bbfdm/dmmap commit dmmap_diagnostics
}

set_tr143_diagnostic_defaults
