summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins/x11vnc/XX_x11vnc.sh
diff options
context:
space:
mode:
authorDirk von Suchodoletz2008-12-22 23:43:43 +0100
committerDirk von Suchodoletz2008-12-22 23:43:43 +0100
commita8b7e47059359904a2953b99e3e634bac0331c71 (patch)
treeeee39a17237230516a76567425b5a38096f78e46 /os-plugins/plugins/x11vnc/XX_x11vnc.sh
parentJust explained the use of the filter script: It allows to dynamically (diff)
downloadcore-a8b7e47059359904a2953b99e3e634bac0331c71.tar.gz
core-a8b7e47059359904a2953b99e3e634bac0331c71.tar.xz
core-a8b7e47059359904a2953b99e3e634bac0331c71.zip
A fix to the packet install mechanism in the x11vnc plugin. Added some
configuration scripting for x11gen mode of the plugin. See [wiki:x11vnc plugin info] for more information. git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2451 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins/plugins/x11vnc/XX_x11vnc.sh')
-rw-r--r--os-plugins/plugins/x11vnc/XX_x11vnc.sh82
1 files changed, 49 insertions, 33 deletions
diff --git a/os-plugins/plugins/x11vnc/XX_x11vnc.sh b/os-plugins/plugins/x11vnc/XX_x11vnc.sh
index d1842e5f..98c29cce 100644
--- a/os-plugins/plugins/x11vnc/XX_x11vnc.sh
+++ b/os-plugins/plugins/x11vnc/XX_x11vnc.sh
@@ -16,21 +16,33 @@
# configuration failed somehow
[ -d /initramfs/plugin-conf ] || error "${init_picfg}" nonfatal
+# function to add vnc functionality to xorg server
+addvnc2xorg () {
+ sed -e '/^# autog/a# modified by x11vnc plugin (adding vnc module config)' \
+ -e '/\"Module\"/a\\ \\ Load "vnc"' \
+ -e '/\"Device\"/a\\ \\ Option "rfbauth"\t "/etc/X11"' \
+ -e '/\"Device\"/a\\ \\ Option "usevnc"\t "yes"}' \
+ -i /mnt/etc/X11/xorg.conf
+}
+
+# main script
if [ -e /initramfs/plugin-conf/x11vnc.conf ]; then
. /initramfs/plugin-conf/x11vnc.conf
if [ $x11vnc_active -ne 0 ]; then
[ $DEBUGLEVEL -gt 0 ] && echo "executing the 'x11vnc' os-plugin ...";
- # create config dir for stage 3
- mkdir -p /mnt/etc/x11vnc
- # default parameters
- PARAMS="-bg -forever"
- # client restrictions
- if [ -z x11vnc_allowed_hosts ]; then
- PARAMS="$PARAMS -allow $x11vnc_allowd_hosts"
- fi
- # mode
+ # configure x11vnc user mode or framebuffer
+ if [ "$x11vnc_mode" = "x11user" || "$x11vnc_mode" = "fb" ] ; then
+ # create config dir for stage 3
+ mkdir -p /mnt/etc/x11vnc
+ # default parameters
+ PARAMS="-bg -forever"
+ # client restrictions
+ if [ -z x11vnc_allowed_hosts ]; then
+ PARAMS="$PARAMS -allow $x11vnc_allowd_hosts"
+ fi
+ # mode
case "$x11vnc_mode" in
- x11)
+ x11user)
PARAMS="$PARAMS -display :0"
X11VNC_X11=1
;;
@@ -67,34 +79,38 @@ if [ -e /initramfs/plugin-conf/x11vnc.conf ]; then
PARAMS="$PARAMS -viewonly"
fi
- # force localhost
- if [ "$x11vnc_force_localhost" = "1" \
- -o "$x11vnc_force_localhost" = "yes" ]; then
- PARAMS="$PARAMS -localhost"
- fi
+ # force localhost
+ if [ "$x11vnc_force_localhost" = "1" \
+ -o "$x11vnc_force_localhost" = "yes" ]; then
+ PARAMS="$PARAMS -localhost"
+ fi
- # enable logging
- if [ "$x11vnc_logging" = "1" -o "$x11vnc_logging" = "yes" ]; then
- PARAMS="$PARAMS -o /var/log/x11vnc.log"
- fi
+ # enable logging
+ if [ "$x11vnc_logging" = "1" -o "$x11vnc_logging" = "yes" ]; then
+ PARAMS="$PARAMS -o /var/log/x11vnc.log"
+ fi
- # shared desktops
- if [ "$x11vnc_shared" = "1" -o "$x11vnc_shared" = "yes" ]; then
- PARAMS="$PARAMS -shared"
- fi
+ # shared desktops
+ if [ "$x11vnc_shared" = "1" -o "$x11vnc_shared" = "yes" ]; then
+ PARAMS="$PARAMS -shared"
+ fi
+
+ # scale desktop
+ if [ "$x11vnc_scale" != "" ]; then
+ $PARAMS="$PARAMS -scale $x11vnc_scale"
+ fi
- # scale desktop
- if [ "$x11vnc_scale" != "" ]; then
- $PARAMS="$PARAMS -scale $x11vnc_scale"
- fi
+ # write config file
+ echo "# parameters generated by $0" > /mnt/etc/x11vnc/x11vnc.conf
+ echo "X11VNC_PARAMS=\"$PARAMS\"" >> /mnt/etc/x11vnc/x11vnc.conf
+ echo "X11VNC_X11=\"$X11VNC_X11\"" >> /mnt/etc/x11vnc/x11vnc.conf
- # write config file
- echo "# parameters generated by $0" > /mnt/etc/x11vnc/x11vnc.conf
- echo "X11VNC_PARAMS=\"$PARAMS\"" >> /mnt/etc/x11vnc/x11vnc.conf
- echo "X11VNC_X11=\"$X11VNC_X11\"" >> /mnt/etc/x11vnc/x11vnc.conf
+ rllinker "x11vnc" 30 10
- rllinker "x11vnc" 30 10
+ [ $DEBUGLEVEL -gt 0 ] && echo "done with 'x11vnc' os-plugin ...";
- [ $DEBUGLEVEL -gt 0 ] && echo "done with 'x11vnc' os-plugin ...";
+ # x11gen allows a general access to the running X server at every time
+ elif [ "$x11vnc_mode" = "x11gen" ]
+ ( waitfor /mnt/etc/X11/xorg.conf 10000; addvnc2xorg ) &
fi
fi