Last change
on this file since 34 was
34,
checked in by hartmans, 18 years ago
|
Add xen and xen-common
|
-
Property svn:executable set to
*
|
File size:
1.4 KB
|
Line | |
---|
1 | #!/bin/bash |
---|
2 | #============================================================================ |
---|
3 | # This script should be installed in /usr/X11R6/bin/Xvnc-xen. |
---|
4 | #============================================================================ |
---|
5 | # |
---|
6 | # Start Xvnc and use vncconnect to connect back to a vncviewer listening in |
---|
7 | # domain 0. The host and port to connect to are given by |
---|
8 | # |
---|
9 | # VNC_VIEWER=<host>:<port> |
---|
10 | # |
---|
11 | # in the kernel command line (/proc/cmdline). |
---|
12 | # |
---|
13 | # The '--vnc' option to 'xm create' will start a vncviewer and |
---|
14 | # pass its address in VNC_VIEWER for this script to find. |
---|
15 | # |
---|
16 | # Usage: |
---|
17 | # Xvnc-xen [args] |
---|
18 | # |
---|
19 | # Any arguments are passed to Xvnc. |
---|
20 | # |
---|
21 | #============================================================================ |
---|
22 | |
---|
23 | # Prefix for messages. |
---|
24 | M="[$(basename $0)]" |
---|
25 | |
---|
26 | # Usage: vnc_addr |
---|
27 | # Print <host>:<port> for the vncviewer given in |
---|
28 | # the kernel command line. |
---|
29 | vnc_addr () { |
---|
30 | sed -n -e "s/.*VNC_VIEWER=\([^ ]*\).*/\1/p" /proc/cmdline |
---|
31 | } |
---|
32 | |
---|
33 | # Usage: vnc_connect |
---|
34 | # If a vncviewer address was given on the kernel command line, |
---|
35 | # run vncconnect for it. |
---|
36 | vnc_connect () { |
---|
37 | local addr=$(vnc_addr) |
---|
38 | |
---|
39 | if [ -n "${addr}" ] ; then |
---|
40 | echo "$M Connecting to ${addr}." |
---|
41 | vncconnect ${addr} |
---|
42 | else |
---|
43 | echo "$M No VNC_VIEWER in kernel command line." |
---|
44 | echo "$M Create the domain with 'xm create --vnc <display>'." |
---|
45 | return 1 |
---|
46 | fi |
---|
47 | } |
---|
48 | |
---|
49 | # Start the vnc server. |
---|
50 | Xvnc "$@" >/dev/null 2>&1 & |
---|
51 | |
---|
52 | # Connect back to the viewer in domain-0. |
---|
53 | vnc_connect |
---|
Note: See
TracBrowser
for help on using the repository browser.