#!/bin/sh

# Move the BMX6 entry to a menu in the qMp page
uci set luci-bmx6.luci=bmx6
uci set luci-bmx6.luci.place="qmp Mesh"
uci set luci-bmx6.luci.position=3
uci set luci-bmx6.luci.json="exec:/www/cgi-bin/bmx6-info -s"
uci set luci-bmx6.luci.ignore=0
uci commit luci-bmx6

# Update BMX6's JSON graph to match the new location of the BMX6 menu
FILENAME="/www/luci-static/resources/bmx6/js/bmx6-graph.js"
if [ -f $FILENAME ]; then
	sed -i 's|/cgi-bin/luci/status/bmx6/topology|/cgi-bin/luci/qmp/Mesh/topology|g' $FILENAME
fi

exit 0
