wok-current rev 11598

dropbear/sshx: add screen support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Jan 14 11:56:41 2012 +0100 (2012-01-14)
parents 32688e8c97a2
children 92066fec6a95
files dropbear/stuff/sshx
line diff
     1.1 --- a/dropbear/stuff/sshx	Fri Jan 13 22:30:26 2012 +0100
     1.2 +++ b/dropbear/stuff/sshx	Sat Jan 14 11:56:41 2012 +0100
     1.3 @@ -4,6 +4,7 @@
     1.4  {
     1.5  	read host type data
     1.6  	svr=$(echo $DISPLAY | sed 's/.*:\([0-9]*\).*/\1/')
     1.7 +	scr=${DISPLAY/*./.}; [ "$scr" == "$DISPLAY" ] && scr=""
     1.8  	n=$((10+($RANDOM % 90))); dpy=localhost:$n
     1.9  	remote=""
    1.10  	while true; do
    1.11 @@ -17,8 +18,8 @@
    1.12  	done
    1.13  	[ -n "$1" ] || set -- "$TERM || xterm"
    1.14  	exec dbclient -f -R $((6000+$n)):localhost:$((6000+$svr)) $remote \
    1.15 -	    "xauth add $dpy $type $data; export DISPLAY=$dpy; $@" \
    1.16 -	    < /dev/null > /dev/null 2>&1
    1.17 +	    "xauth add $dpy $type $data; export DISPLAY=$dpy$scr; $@ ; xauth remove $dpy" \
    1.18 +	    < /dev/null > /dev/null
    1.19  }
    1.20  
    1.21  case "$DISPLAY" in