#!/bin/sh
# Copyright (c) 2000-2013 Synology Inc. All rights reserved.

PACKAGE_DIR="/var/packages/${SYNOPKG_PKGNAME}"
CMS_CONF_FILE="${PACKAGE_DIR}/etc/cmsinfo.conf"

#SERVICE_PLUGIN_SCRIPT="/usr/local/libexec/service/CMSUpdateCred.sh"
SERVICE_PLUGIN_SCRIPT_IPv4="/usr/local/libexec/net/ipv4_change/CMSUpdateCred.sh"
SERVICE_PLUGIN_SCRIPT_IPv6="/usr/local/libexec/net/ipv6_change/CMSUpdateCred.sh"
SERVICE_PLUGIN_SCRIPT_LINK_UP="/usr/local/libexec/net/if_link_up/CMSUpdateCred.sh"
DSM_PORT_PLUGIN_SCRIPT="/usr/local/libexec/dsm_port_chg/CMSUpdateCred.sh"

if [ -e ${CMS_CONF_FILE} ]; then
	/bin/rm -f ${CMS_CONF_FILE}
fi

#if [ -e ${SERVICE_PLUGIN_SCRIPT_IPv4} ]; then
#	/bin/rm -f ${SERVICE_PLUGIN_SCRIPT_IPv4}
#fi

#if [ -e ${SERVICE_PLUGIN_SCRIPT_IPv6} ]; then
#	/bin/rm -f ${SERVICE_PLUGIN_SCRIPT_IPv6}
#fi

#if [ -e ${SERVICE_PLUGIN_SCRIPT_LINK_UP} ]; then
#	/bin/rm -f ${SERVICE_PLUGIN_SCRIPT_LINK_UP}
#fi

#if [ -e ${DSM_PORT_PLUGIN_SCRIPT} ]; then
#	/bin/rm -f ${DSM_PORT_PLUGIN_SCRIPT}
#fi

#if [ -e "/usr/local/etc/logrotate.d/cms" ]; then
#	/bin/rm -f "/usr/local/etc/logrotate.d/cms"
#fi

#if [ -e "/usr/local/etc/syslog-ng/patterndb.d/cms.conf" ]; then
#	/bin/rm -f "/usr/local/etc/syslog-ng/patterndb.d/cms.conf"
#fi

#synoservicectl --restart syslog-ng

#if [ -e "/usr/syno/etc/user.data.conf/cms.config" ]; then
#	/bin/rm -f "/usr/syno/etc/user.data.conf/cms.config"
#fi



exit 0
