wok-next diff dropbear/stuff/sshx @ rev 18015

dropbear: pppssh may use ssh keys
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat May 02 12:05:22 2015 +0200 (2015-05-02)
parents 31599711e814
children 56c606af68bc
line diff
     1.1 --- a/dropbear/stuff/sshx	Sat Feb 08 16:59:03 2014 +0000
     1.2 +++ b/dropbear/stuff/sshx	Sat May 02 12:05:22 2015 +0200
     1.3 @@ -24,14 +24,16 @@
     1.4  
     1.5  pppssh()
     1.6  {
     1.7 -	[ -z "$DROPBEAR_PASSWORD" ] && echo -n "ssh password: " &&
     1.8 -	read -s -t 30 DROPBEAR_PASSWORD && export DROPBEAR_PASSWORD
     1.9 +	ssh="dbclient -y"
    1.10 +	$ssh $1 true || {
    1.11 +		[ -z "$DROPBEAR_PASSWORD" ] && echo -n "ssh password: " &&
    1.12 +		read -s -t 30 DROPBEAR_PASSWORD && export DROPBEAR_PASSWORD
    1.13 +		$ssh $1 true || exit 1
    1.14 +	}
    1.15  	for i in $4 ; do
    1.16  		echo "route add -net $i dev \$1"
    1.17  	done > /etc/ppp/ip-up.d/pppssh$$
    1.18  	chmod +x /etc/ppp/ip-up.d/pppssh$$
    1.19 -	ssh="dbclient -y"
    1.20 -	$ssh $1 true || exit 1
    1.21  	n=10.$(($$%256)).$(($$/256))
    1.22  	ppp="/usr/sbin/pppd local noauth nodetach"
    1.23  	$ppp ${2:-$n.1:$n.2} passive pty "$ssh $1 $ppp ${3:-proxyarp} notty" \