#!/bin/sh

uci -q set mac.@mac[0].interface="wan"
[ -n $`uci -q get network.wan_dev` ] && uci -q set mac.@mac[0].interface="wan_dev"
uci commit mac

chmod 777 /etc/init.d/mac 

rm -f /tmp/luci-indexcache
exit 0