summaryrefslogtreecommitdiffstats
path: root/rdp
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2020-01-13 09:04:20 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2020-01-13 09:04:20 +0100
commita9f8bc0ad4ce03c6df0f6e4fa4c7eef1cde24bd4 (patch)
tree406583915eb5745213591f6f5757f045995a8abf /rdp
parent7b3930dd77a0daa4d422d317d5105f4007d293e8 (diff)
downloadbin-a9f8bc0ad4ce03c6df0f6e4fa4c7eef1cde24bd4.zip
bin-a9f8bc0ad4ce03c6df0f6e4fa4c7eef1cde24bd4.tar.gz
add rdp
Diffstat (limited to 'rdp')
-rwxr-xr-xrdp29
1 files changed, 29 insertions, 0 deletions
diff --git a/rdp b/rdp
new file mode 100755
index 0000000..117a790
--- /dev/null
+++ b/rdp
@@ -0,0 +1,29 @@
+#! /bin/sh
+
+[ $# -lt 1 ] && echo "missing hostname" && exit 1
+
+OPTS="/kbd:0x0000100C"
+host="$1"
+
+if [ $# -gt 1 ]; then
+ f="$HOME/.smb/$2.auth"
+else
+ f="$HOME/.smb/$1.auth"
+fi
+
+echo " loading $f"
+if [ -r "$f" ];then
+ username=$(cat $f | sed -ne 's/username=\(.*\)/\1/p; s/\n//g')
+ password=$(cat $f | sed -ne 's/password=\(.*\)/\1/p; s/\n//g')
+ domain=$(cat $f | sed -ne 's/domain=\(.*\)/\1/p; s/\n//g')
+else
+ echo "$f is not readable" && exit 1
+fi
+
+[ -z "$d" ] && domain="$1"
+[ -z "$password" ] || password="$password"
+
+OPTS="$OPTS /u:$username /p:$password /v:$host"
+
+echo /usr/bin/xfreerdp $OPTS
+/usr/bin/xfreerdp $OPTS