# HG changeset patch # User Pascal Bellard # Date 1469533639 -7200 # Node ID 1ae2567134a8a2b637fabe45f0cb08395ad4a1db # Parent cfa37fb98858d28a676af725878f7990b7ad6378 drobbear/pppssh: optional UDP unencrypted link diff -r cfa37fb98858 -r 1ae2567134a8 dropbear/stuff/sshx --- a/dropbear/stuff/sshx Mon Jul 25 12:47:51 2016 +0300 +++ b/dropbear/stuff/sshx Tue Jul 26 13:47:19 2016 +0200 @@ -30,7 +30,7 @@ read -s -t 30 DROPBEAR_PASSWORD && export DROPBEAR_PASSWORD $ssh $1 true || exit 1 } - extra="$(route -n | awk -vd=$(nslookup ${1#*@} | \ + extra="$(route -n | awk -vd=$(nslookup ${1#*@} | sed '/::/d' | \ sed '$!d;s/.*: \([^ ]*\).*/\1/') \ '$1=="0.0.0.0"{ print d " gw " $2 " dev " $8 }')" for i in ${4/default/128.0.0.0/1 0.0.0.0/1} ; do @@ -39,11 +39,14 @@ [ "$4" ] && echo "route add $extra" >> /etc/ppp/ip-up.d/pppssh$$ chmod +x /etc/ppp/ip-up.d/pppssh$$ n=10.$(($$%256)).$(($$/256)) + n="${2:-$n.1:$n.2} passive" ppp="/usr/sbin/pppd local noauth nodetach" - $ppp ${2:-$n.1:$n.2} passive pty "$ssh $1 $ppp ${3:-proxyarp} notty" \ - ipparam pppssh$$ + arg="$n pty '$ssh $1 $ppp ${3:-proxyarp} notty'" + [ -n "$5" ] && arg="noipdefault pty 'nc -u ${1#*@} $5'" && $ssh -f $1 \ + "$ppp $n ${3:-proxyarp} pty 'nc -ulp $5' >/dev/null" + eval $ppp $arg ipparam pppssh$$ [ "$4" ] && route del $extra - rm -f /etc/ppp/ip-up.d/pppssh$$ + rm -f /etc/ppp/ip-up.d/pppssh$$ 2> /dev/null } xfbvnc() @@ -63,7 +66,7 @@ $(fbvnc --help 2>&1 | sed '1,/Usage:/d') EOT ppp*) [ -z "$1" ] && cat <$(_ 'Peer routes') + + $(_ 'UDP port') + +