From d54814233c3658b6f5138dc16c91ac2ee5da55ad Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Sun, 1 Aug 2010 05:52:47 +0200 Subject: [PATCH] Added rdp. --- rdp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 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" -- 2.11.0