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

. "$(dirname $0)"/common
. "$ETC_PATH"/config

"$WEBAPI_BIN" --exec api=SYNO.Docker.Container version=1 method=delete name="$LXQT_NAME" force=true preserve_profile=false
"$DOCKER_BIN" rmi synology/lxqt:0.10.0-1

if [ "$SYNOPKG_PKG_STATUS" != UPGRADE ]; then
	if ! rm -Rf "$SHARE_PATH/$SHARE"; then
		logger -p 0 "$PKG_NAME: failed to remove the folder $SHARE"
		log "$failed_remove_dir" "$SHARE"
	fi

	rm "$ETC_PATH"/config
fi

exit 0
