-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathavctviewer.sh
executable file
·85 lines (66 loc) · 2.18 KB
/
avctviewer.sh
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
JAVAPATH=$APPDIR/usr/jre1.6.0_27/
man() {
cat - >&2 <<EOF
NAME
$ARGV0 - Connect to an Avocent (or OEM) IP KVM Switch
EOF
}
usage() {
cat - >&2 <<EOF
$ARGV0 SERVERNAME KVMHOST -p portnumber
$ARGV0 SERVERNAME KVMHOST -r DSQRId
Options:
-p Portnumber that the required server is connected to.
-r Unique Id of servers KVM 'dongle'
-t Alternate title for window
-u Username ( default: Admin)
-P Password (default is blank)
EOF
}
fatal() {
for i; do
echo -e "${i}" >&2
done
exit 1
}
UNITSPEC=""
TITLE=""
USERNAME="Admin"
OEM="HP"
optspec="hp:r:t:u:P:"
SERVERNAME=$1;
case "x$SERVERNAME" in
x-h) ;;
x-*|x) fatal "Expected Servername before options" ;;
*) shift ;;
esac
IPADDRESS=$1;
case "x$IPADDRESS" in
x-h) ;;
x-*|x) fatal "Expected Hostname before options" ;;
*) shift ;;
esac
while getopts "$optspec" optchar ; do
case "$optchar" in
h) usage; exit 0 ;;
p) UNITSPEC="p:$OPTARG" ;;
r) UNITSPEC="r:$OPTARG" ;;
t) TITLE=$OPTARG ;;
o) OEM=$OPTARG ;;
u) USERNAME=$OPTARG ;;
P) PASSWD=$OPTARG; shift ;;
*) fatal "Unknown option: '-${optchar}'" "See '${0} -h for usage" ;;
esac
done
TITLE=${TITLE:=$SERVERNAME}
# Debugging!
#echo "Viewer with $SERVERNAME , $IPADDRESS, $OEM, $UNITSPEC, $TITLE, $USERNAME, $PASSWD"
#echo LD_LIBRAY_PATH=$JAVAPATH/lib/amd64 $JAVAPATH/bin/java -Djava.security.properties=$APPDIR/etc/java-6-openjdk/security/java.security -Duser.variant=$OEM -Doem.variant=$OEM -cp './share/avctviewer/*' \
# com.avocent.video.Nautilus\
# devicetype=avsp oem=$OEM path="a:$IPADDRESS,$UNITSPEC,s:$SERVERNAME,e:1,c:0" user=$USERNAME password=$PASSWD title=$SERVERNAME
#
## The 'c:' element of Path is channel; but channel 0 seems to be what need to alwts be specified
LD_LIBRAY_PATH=$JAVAPATH/lib/amd64 $JAVAPATH/bin/java -Djava.security.properties=$APPDIR/etc/java-6-openjdk/security/java.security -Duser.variant=$OEM -Doem.variant=$OEM -cp './share/avctviewer/*' \
com.avocent.video.Nautilus\
devicetype=avsp oem=$OEM path="a:$IPADDRESS,$UNITSPEC,s:$SERVERNAME,e:1,c:0" user=$USERNAME password=$PASSWD title=$SERVERNAME