wok-current rev 10919
dropbear: not only server :0
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Aug 04 09:44:39 2011 +0200 (2011-08-04) |
parents | 94fce58dc778 |
children | e542ba4fbc72 |
files | dropbear/stuff/sshx |
line diff
1.1 --- a/dropbear/stuff/sshx Wed Aug 03 21:46:06 2011 +0200 1.2 +++ b/dropbear/stuff/sshx Thu Aug 04 09:44:39 2011 +0200 1.3 @@ -3,12 +3,13 @@ 1.4 xdbclient() 1.5 { 1.6 read host type data 1.7 - n=10; dpy=localhost:$n 1.8 - dbclient -R $((6000+$n)):localhost:6000 "$@" \ 1.9 + svr=$(echo $DISPLAY | sed 's/.*:\([0-9]*\).*/\1/') 1.10 + n=$((10+$svr)); dpy=localhost:$n 1.11 + dbclient -R $((6000+$n)):localhost:$((6000+$svr)) "$@" \ 1.12 "xauth add $dpy $type $data; export DISPLAY=$dpy; $TERM" 1.13 } 1.14 1.15 -case "$TERM" in 1.16 -xterm*|rxvt*) xauth list :0 | xdbclient "$@" ;; 1.17 -*) dbclient "$@" ;; 1.18 +case "$DISPLAY" in 1.19 +'') dbclient "$@" ;; 1.20 +*) xauth list $DISPLAY | xdbclient "$@" ;; 1.21 esac