wok-current rev 18330

dropbear: add sshfbvnc
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Sep 09 08:55:46 2015 +0200 (2015-09-09)
parents 774ccdbc61ce
children c68cd3e0f194
files dropbear/receipt dropbear/stuff/sshx
line diff
     1.1 --- a/dropbear/receipt	Wed Sep 09 03:45:43 2015 -0300
     1.2 +++ b/dropbear/receipt	Wed Sep 09 08:55:46 2015 +0200
     1.3 @@ -75,6 +75,7 @@
     1.4  	ln -s daemon $fs/etc/init.d/ssh
     1.5  	cp -a $stuff/sshx $fs/usr/bin
     1.6  	ln -s sshx $fs/usr/bin/pppssh
     1.7 +	ln -s sshx $fs/usr/bin/sshfbvnc
     1.8  	touch $fs/etc/dropbear/dropbear_dss_host_key \
     1.9  		$fs/etc/dropbear/dropbear_rsa_host_key
    1.10  
     2.1 --- a/dropbear/stuff/sshx	Wed Sep 09 03:45:43 2015 -0300
     2.2 +++ b/dropbear/stuff/sshx	Wed Sep 09 08:55:46 2015 +0200
     2.3 @@ -46,7 +46,20 @@
     2.4  	rm -f /etc/ppp/ip-up.d/pppssh$$
     2.5  }
     2.6  
     2.7 +xfbvnc()
     2.8 +{
     2.9 +	p=5900
    2.10 +	while netstat -tln | grep -q ":$p " ; do p=$(($p+1)); done
    2.11 +	dbclient -f -N -L $p:127.0.0.1:${2:-5900} $1
    2.12 +	fbvnc 127.0.0.1 $p
    2.13 +	kill $(netstat -tlnp 2> /dev/null | \
    2.14 +	       sed "/:$p /!d;s|.* \\([0-9]*\\)/[^ ]*|\\1|")
    2.15 +}
    2.16 +
    2.17  case "$(basename $0)" in
    2.18 +*vnc)	[ -z "$1" ] && cat <<EOT || xfbvnc "$@" ;;
    2.19 +Usage: $0 '[sshargs] user@remote' [vncport]
    2.20 +EOT
    2.21  ppp*)	[ -z "$1" ] && cat <<EOT || pppssh "$@" ;;
    2.22  Usage: $0 '[sshargs] user@remote' '[localip:remoteip] [localpppargs]' 'remotepppargs' 'routes' 
    2.23  Example: $0 tux@slitaz.org '' '' '192.168.1.0/24 10.1.2.0/24'