#!/bin/sh

CONFIG_FOLDER=/usr/local/zy-pkgs/config/Memopal
CONFIG_FILE=/usr/local/zy-pkgs/config/Memopal/localConfig
RESET_FLAG=/tmp/PKG_RESET
PACKAGE_NAME=Memopal

killall -9 memopal

if [ -e ${CONFIG_FILE} ]; then
	sed -i '1c status: 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 -rf ${CONFIG_FOLDER}
fi

exit 0
