From: Fredrik Tolf Date: Sun, 1 Aug 2010 03:52:47 +0000 (+0200) Subject: Added rdp. X-Git-Url: http://git.dolda2000.com/gitweb/?p=utils.git;a=commitdiff_plain;h=d54814233c3658b6f5138dc16c91ac2ee5da55ad Added rdp. --- diff --git a/rdp b/rdp new file mode 100755 index 0000000..85956cc --- /dev/null +++ b/rdp @@ -0,0 +1,37 @@ +#!/bin/bash + +usage() { + echo "usage: rdp [-hf] HOST [PORT|INSTANCE]" +} + +args=(-K -r sound) +fs= +while [ "${1:0:1}" = - ]; do + a="$1" + shift + case "$a" in + -h) + usage + exit 0 + ;; + -f) + fs=y + ;; + esac +done +if [ "$fs" = y ]; then args=("${args[@]}" -f); else args=("${args[@]}" -g 1280x960); fi + +if [ $# -lt 1 ]; then + usage >&2 + exit 1 +fi + +port=3389 +if [ $# -ge 2 ]; then + port="$2" + if [ "$port" -lt 100 ]; then + port=$((port + 3389)) + fi +fi + +exec rdesktop "${args[@]}" "$1:$port"