#!/bin/sh

CONFIG_FILE=/usr/local/zy-pkgs/config/DyDNS/config.data
RESET_FLAG=/tmp/PKG_RESET
PACKAGE_NAME=DyDNS

killall -9 inadyn
killall -9 ez-ipupdate

if [ -e ${CONFIG_FILE} ]; then
	sed -i '1c disable' ${CONFIG_FILE}
fi

#check need or not reset the configuration file
if [ -f "${RESET_FLAG}" ]; then
        isReset=`cat ${RESET_FLAG} | grep ${PACKAGE_NAME}`
fi

if [ "${isReset}" != "" ]; then
	#remove config file
	/bin/rm ${CONFIG_FILE}
fi

exit 0
