wok-current view dropbear/stuff/sshx @ rev 11594

dropbear/sshx: background
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Jan 13 10:58:50 2012 +0100 (2012-01-13)
parents 0078fa9a46a4
children 32688e8c97a2
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 -f -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