wok-next view dropbear/stuff/sshx @ rev 12959

gobby: update bdeps
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu May 31 20:16:47 2012 +0200 (2012-05-31)
parents 32688e8c97a2
children caf768bb46f9
line source
1 #!/bin/sh
3 xdbclient()
4 {
5 read host type data
6 svr=$(echo $DISPLAY | sed 's/.*:\([0-9]*\).*/\1/')
7 scr=${DISPLAY/*./.}; [ "$scr" == "$DISPLAY" ] && scr=""
8 n=$((10+($RANDOM % 90))); dpy=localhost:$n
9 remote=""
10 while true; do
11 arg="$1"; shift
12 remote="$remote $arg"
13 case "$arg" in
14 -[piIlLRWKBJ]) remote="$remote $1"; shift ;;
15 -*) ;;
16 *) break ;;
17 esac
18 done
19 [ -n "$1" ] || set -- "$TERM || xterm"
20 exec dbclient -f -R $((6000+$n)):localhost:$((6000+$svr)) $remote \
21 "xauth add $dpy $type $data; export DISPLAY=$dpy$scr; $@ ; xauth remove $dpy" \
22 < /dev/null > /dev/null
23 }
25 case "$DISPLAY" in
26 '') exec dbclient "$@" ;;
27 *) xauth list $DISPLAY | xdbclient "$@" ;;
28 esac