wok view dropbear/stuff/sshx @ rev 11593

dropbear/sshx: fallback to xterm
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Jan 13 10:51:19 2012 +0100 (2012-01-13)
parents 0a4cc644e631
children 3b8e288fd269
line source
1 #!/bin/sh
3 xdbclient()
4 {
5 read host type data
6 svr=$(echo $DISPLAY | sed 's/.*:\([0-9]*\).*/\1/')
7 n=$((10+$svr)); dpy=localhost:$n
8 dbclient -R $((6000+$n)):localhost:$((6000+$svr)) "$@" \
9 "xauth add $dpy $type $data; export DISPLAY=$dpy; $TERM || xterm" \
10 < /dev/null > /dev/null 2>&1
11 }
13 case "$DISPLAY" in
14 '') dbclient "$@" ;;
15 *) xauth list $DISPLAY | xdbclient "$@" ;;
16 esac