#!/bin/sh

# add log_info ucitrack entry
uci -q batch <<-EOF >/dev/null
                del ucitrack.@bluetooth[-1]
                add ucitrack bluetooth
                set ucitrack.@bluetooth[-1].init="bluetooth"
                commit ucitrack
EOF
board_family="`cat /tmp/sysinfo/board_family 2>/dev/null | grep -i G520`"
if [ "$board_family" == "" ];then #X_Series
	uci set bluetooth.slave0.server_accept_port='10002'
	uci set bluetooth.master1.server_accept_port='10003'
	uci set bluetooth.master2.server_accept_port='10004'
else
	uci set bluetooth.slave0.server_accept_port='10003'
	uci set bluetooth.master1.server_accept_port='10004'
	uci set bluetooth.master2.server_accept_port='10005'
fi
uci commit bluetooth
# remove LuCI cache
rm -rf /tmp/luci-indexcache /tmp/luci-modulecache

/etc/init.d/bluetooth enable
