summaryrefslogtreecommitdiffstats
path: root/rdesktop
blob: 9769d0df4a91c74e7c9459873a9b4f300535808d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#! /bin/sh

[ $# -lt 1 ] && echo "missing hostname" && exit 1

OPTS="-0 -g 1280x1024 -k fr-ch"
host="$1"

if [ $# -gt 1 ]; then
    f="$HOME/.smb/$2.auth"
else
    f="$HOME/.smb/$1.auth"
fi

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="-p $password"

OPTS="$OPTS -d $domain -u $username $password $host"

/usr/bin/rdesktop $OPTS