#!/bin/sh
set -e

PROGRAM=/usr/libexec/hercules/hercifc

if [ "$1" = configure ]; then
	if which setcap > /dev/null && [ -e "$PROGRAM" ]; then
		if ! setcap CAP_NET_ADMIN=ep "$PROGRAM" >/dev/null 2>&1; then
			cat <<EOT
Setting capabilities for hercifc failed; TUN/TAP networking might not work
as an unprivileged user.
EOT
		fi
	fi
fi

#DEBHELPER#
