#!/bin/sh
[ -z "$D" ] && PID=`pidof xinetd` && kill -HUP $PID || true
OPTS=""

if [ -n "$D" ]; then
    OPTS="--root=$D"
fi

if type systemctl >/dev/null 2>/dev/null; then
	systemctl $OPTS enable streamproxy.socket

	if [ -z "$D" -a "enable" = "enable" ]; then
		systemctl restart streamproxy.socket
	fi
fi
