#!/bin/sh

# Из-за какого-то сертификата указывается полный путь
RHOST=win10.office.etersoft.ru

OPTIONS="/smartcard /sound +clipboard /dynamic-resolution"

USERARG=/u:$USER
if echo "$1" | grep -q "^/u:" ; then
    USERARG="$1"
    shift
fi

epm assure xfreerdp || exit

echo "Connect as user $USERARG ..."

a= xfreerdp $USERARG /v:$RHOST $OPTIONS "$@"
