#!/usr/bin/env /lib/runit/invoke-run
set -e

NAME="xrdp"
DAEMON=/usr/sbin/$NAME

[ -f /etc/default/xrdp ] && . /etc/default/xrdp

# Exit service if DAEMON is not installed
if [ ! -x $DAEMON ]; then
    exit 161
fi

exec 2>&1

echo "Starting $NAME..."
exec $DAEMON --nodaemon
