#!/bin/sh

PHOTO_APACHE_CONF="SYNO.SDS.PhotoStation.conf"
UPGRADE_FILE="/tmp/synophoto.upgrade"

SYNO_SERVICE_TOOL="/usr/syno/sbin/synoservice"
SYNO_SERVICE_CTL_TOOL="/usr/syno/sbin/synoservicectl"

WATERMARK_DIR=${SYNOPKG_PKGDEST}/watermarks
WATERMARK_TMP_DIR=${SYNOPKG_PKGDEST_VOL}/@tmp

PHOTO_NGINX_DISABLED_CONF="www.PhotoStation.disabled.conf"
NGINX_CONF_FOLDER="/usr/local/etc/nginx/conf.d"

remove_user_data_collector_file() {
	local destconf="/usr/syno/etc/user.data.conf/photostation.config"
	local destbinary="/usr/syno/bin/user.data.collector/synouserdata_photostation"

	rm -f ${destconf} ${destbinary}
}

remove_nginx_conf()
{
	rm -f $NGINX_CONF_FOLDER/$PHOTO_NGINX_DISABLED_CONF
}

remove_user_data_collector_file
remove_nginx_conf

if [ -e ${WATERMARK_DIR} ]; then
        mv ${WATERMARK_DIR} ${WATERMARK_TMP_DIR}
fi

exit 0
