#!/bin/sh

[ ! -f /etc/config/mmdvm ] && touch /etc/config/mmdvm
[ -z `uci -q get mmdvm.P25.Enable` ] && {
	uci set mmdvm.P25=mmdvmhost
	uci set mmdvm.P25.Enable=0
	uci commit mmdvm
}

ENABLE=$(uci -q get mmdvm.P25.Enable)
if [ "$ENABLE" != "1" ]; then
    /etc/init.d/p25gateway stop && /etc/init.d/p25gateway disable
    /etc/init.d/p25parrot stop && /etc/init.d/p25parrot disable
fi

exit 0
