[issue877] automatically vnc connection to a listening vnc client (like vnc ... --connect ip:port)
Alexander Wirt
bts at bts.grml.org
Sat Jul 3 13:22:57 CEST 2010
New submission from Alexander Wirt <formorer at formorer.de>:
Here is a first patch from me (untested) against grml-autoconfig and grml-etc
diff --git a/autoconfig.functions b/autoconfig.functions
index 0b9d51d..fb45924 100755
--- a/autoconfig.functions
+++ b/autoconfig.functions
@@ -1506,6 +1506,7 @@ if checkbootparam 'vnc' ; then
fi
eoutdent
+
# finally check if we have a password we can use:
if [ -n "$VNC_PASSWD" ] ; then
@@ -1520,6 +1521,15 @@ if checkbootparam 'vnc' ; then
/bin/chown -R "$USER": "$VNCDIR"
fi
fi
+ if checkbootparam 'vnc_connect' ; then
+ VNC_CONNECT=''
+ VNC_CONNECT="$(getbootparam 'vnc_connect' 2>>$DEBUG)"
+ einfo "Bootoption vnc_connect found, will start vnc with connect to
$VNC_CONNECT."
+ #store the options in a file
+ VNCDIR="/home/${USER}/.vnc"
+ [ -d "$VNCDIR" ] || mkdir "$VNCDIR"
+ echo " --connect $VNC_CONNECT " >> $VNCDIR/options
+ fi
fi
}
# }}}
diff --git a/etc/skel/.xinitrc.d/grml_vnc b/etc/skel/.xinitrc.d/grml_vnc
index eff5a40..2606020 100755
--- a/etc/skel/.xinitrc.d/grml_vnc
+++ b/etc/skel/.xinitrc.d/grml_vnc
@@ -12,8 +12,10 @@ fi
# if the vnc bootoption sets up the password let's start the vnc server
if [ -e $HOME/.vnc/passwd ]; then
+ test -f $HOME/.vnc/options && OPTIONS=$(cat $HOME/.vnc/options)
+
/usr/bin/x11vnc -bg -forever -noxdamage -o $HOME/.vnc/x11vnc.log -rfbauth \
- $HOME/.vnc/passwd -auth $HOME/.Xauthority -display $DISPLAY
+ $HOME/.vnc/passwd -auth $HOME/.Xauthority -display $DISPLAY
$OPTIONS
fi
## END OF FILE #################################################################
----------
assignedto: formorer
messages: 3261
nosy: formorer, technikfreak
priority: feature
status: chatting
title: automatically vnc connection to a listening vnc client (like vnc ... --connect ip:port)
topic: grml-autoconfig
_____________________________________
GRML issue tracker <bts at bts.grml.org>
<http://bts.grml.org/grml/issue877>
_____________________________________
More information about the Bugs-changes
mailing list