#!/bin/sh
set -e

if [ "$1" = configure ]; then
	if command -v setcap > /dev/null; then
		if setcap cap_ipc_lock+eip /usr/bin/dde-dock;then
			chmod u-s /usr/bin/dde-dock
		else
			echo "Setcap failed, falling back to setuid" >&2
			chmod u+s /usr/bin/dde-dock
		fi
	else
		echo "Setcap is not installed, falling back to setuid" >&2
		chmod u+s /usr/bin/dde-dock
	fi  
fi

#DEBHELPER#

exit 0
