wok-6.x rev 19370

ppp: remove pppnc (done by pppssh)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Aug 09 11:14:54 2016 +0200 (2016-08-09)
parents 90198f573d18
children 38da7d1a1d04
files ppp/receipt ppp/stuff/ppp.cgi ppp/stuff/pppnc-server
line diff
     1.1 --- a/ppp/receipt	Tue Aug 09 11:03:52 2016 +0200
     1.2 +++ b/ppp/receipt	Tue Aug 09 11:14:54 2016 +0200
     1.3 @@ -34,8 +34,6 @@
     1.4  	mkdir -p $fs/usr $fs/var/www/tazpanel/menu.d/network/VPN
     1.5  	cp -a $install/usr/sbin $fs/usr
     1.6  	[ -d "$install/usr/lib" ] && cp -a $install/usr/lib $fs/usr
     1.7 -	cp -a $stuff/pppnc-server $fs/usr/sbin
     1.8 -	ln $fs/usr/sbin/pppnc-server $fs/usr/sbin/pppnc-client
     1.9  	cp -a $stuff/ppp.cgi $fs/var/www/tazpanel
    1.10  	ln -s ../../ppp.cgi $fs/var/www/tazpanel/menu.d/network/ppp
    1.11  	ln -s ../../../ppp.cgi $fs/var/www/tazpanel/menu.d/network/VPN/ppp
     2.1 --- a/ppp/stuff/ppp.cgi	Tue Aug 09 11:03:52 2016 +0200
     2.2 +++ b/ppp/stuff/ppp.cgi	Tue Aug 09 11:14:54 2016 +0200
     2.3 @@ -23,9 +23,6 @@
     2.4  		[ "$(which pppssh 2>/dev/null)" ] && cat <<EOT
     2.5  <li><a data-icon="vpn" href="ppp.cgi#pppssh" data-root>$(_ 'PPP/SSH')</a></li>
     2.6  EOT
     2.7 -		cat <<EOT
     2.8 -<li><a data-icon="upgrade" href="ppp.cgi#pppnc" data-root>$(_ 'Route shortcut')</a></li>
     2.9 -EOT
    2.10  		;;
    2.11  		*)
    2.12  		cat <<EOT
    2.13 @@ -79,14 +76,6 @@
    2.14  		killall pppd
    2.15  	fi
    2.16  	;;
    2.17 -*\ setpppnc\ *)
    2.18 -	[ "$(GET stop_pppncs)" ] && killall pppnc-server
    2.19 -	[ "$(GET start_pppncs)" ] &&
    2.20 -		pppnc-server "$(GET port)" "$(GET localip):$(GET remoteip)" &
    2.21 -	[ "$(GET stop_pppncc)" ] && killall pppnc-client
    2.22 -	[ "$(GET start_pppncc)" ] &&
    2.23 -		pppnc-client "$(GET serverip)" "$(GET port)" "$(GET routes)" &
    2.24 -	;;
    2.25  *\ setpppssh\ *)
    2.26  	cat > /etc/ppp/pppssh <<EOT
    2.27  PEER="$(GET peer)"
    2.28 @@ -128,8 +117,6 @@
    2.29  ACCOUNT="$(sed '/^ACCOUNT=/!d;s/^.*=\([^ \t]*\).*/\1/' /etc/ppp/scripts/ppp-on)"
    2.30  PASSPSTN="$(sed '/^PASSWORD=/!d;s/^.*=\([^ \t]*\).*/\1/' /etc/ppp/scripts/ppp-on)"
    2.31  PHONE="$(sed '/^TELEPHONE=/!d;s/^.*=\([^ \t]*\).*/\1/' /etc/ppp/scripts/ppp-on)"
    2.32 -busybox ps x | grep -v grep | grep -q pppnc_server || stops_disabled='disabled'
    2.33 -busybox ps x | grep -v grep | grep -q pppnc_client || stopc_disabled='disabled'
    2.34  TITLE="$(_ 'TazPanel - Network') - $(_ 'PPP Connections')"
    2.35  header
    2.36  xhtml_header | sed 's/id="content"/id="content-sidebar"/'
    2.37 @@ -247,46 +234,6 @@
    2.38  	--></footer>
    2.39  </form>
    2.40  </section>
    2.41 -
    2.42 -<a name="pppnc"></a>
    2.43 -<section>
    2.44 -	<header>
    2.45 -		<span data-icon="upgrade">$(_ 'Route shortcut') -
    2.46 -		$(_ 'Reach unreachable networks')</span>
    2.47 -	</header>
    2.48 -<form method="get">
    2.49 -	<input type="hidden" name="setppprc" />
    2.50 -	<table>
    2.51 -	<tr>
    2.52 -		<td>$(_ 'UDP port')</td>
    2.53 -		<td><input type="text" name="port" size="50" value="1111" /></td>
    2.54 -	</tr>
    2.55 -	<tr> <td colspan=2 align=center>--- $(_ 'Server only') ---</td> </tr>
    2.56 -	<tr>
    2.57 -		<td>$(_ 'Local IP address')</td>
    2.58 -		<td><input type="text" name="localip" size="50" value="${LOCALIP:-192.168.254.1}" /></td>
    2.59 -	</tr>
    2.60 -	<tr>
    2.61 -		<td>$(_ 'Remote IP address')</td>
    2.62 -		<td><input type="text" name="remoteip" size="50" value="${REMOTEIP:-192.168.254.2}" /></td>
    2.63 -	<tr> <td colspan=2 align=center>--- $(_ 'Client only') ---</td> </tr>
    2.64 -	<tr>
    2.65 -		<td>$(_ 'Server IP address')</td>
    2.66 -		<td><input type="text" name="serverip" size="50" value="1.2.3.4" /></td>
    2.67 -	</tr>
    2.68 -	<tr>
    2.69 -		<td>$(_ 'Server routes')</td>
    2.70 -		<td><input type="text" name="routes" size="50" value="${ROUTES:-192.168.10.0/24 192.168.20.0/28}" title="$(_ "Routes on peer network to import or 'default' to redirect the default route")"/></td>
    2.71 -	</tr>
    2.72 -	</table>
    2.73 -	<footer><!--
    2.74 -		--><button type="submit" name="start_pppncs" data-icon="start" >$(_ 'Start server'  )</button><!--
    2.75 -		--><button type="submit" name="stop_pppncs"  data-icon="stop" $stops_disabled>$(_ 'Stop server'   )</button><!--
    2.76 -		--><button type="submit" name="start_pppncc" data-icon="start" >$(_ 'Start client'  )</button><!--
    2.77 -		--><button type="submit" name="stop_pppncc"  data-icon="stop" $stopc_disabled>$(_ 'Stop client'   )</button><!--
    2.78 -	--></footer>
    2.79 -</form>
    2.80 -</section>
    2.81  EOT
    2.82  if [ "$(which pppssh 2>/dev/null)" ]; then
    2.83  	[ -s /etc/ppp/pppssh ] && . /etc/ppp/pppssh
     3.1 --- a/ppp/stuff/pppnc-server	Tue Aug 09 11:03:52 2016 +0200
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,23 +0,0 @@
     3.4 -#!/bin/sh
     3.5 -
     3.6 -ppp="/usr/sbin/pppd local noauth nodetach"
     3.7 -port=1111
     3.8 -ipupd=/etc/ppp/ip-up.d
     3.9 -
    3.10 -case "$0" in
    3.11 -*server) # Usage: pppnc-server [port] [localip:remoteip]
    3.12 -	n=10.$(($$%256)).$(($$/256))
    3.13 -	exec $ppp ${2:-$n.1:$n.2} passive proxyarp pty "nc -ulp ${1:-$port}"
    3.14 -esac
    3.15 -
    3.16 -[ -z "$1" ] && echo "Usage: $0 serverip [port] [routes]" && exit 1
    3.17 -extra="$(route -n | awk -vd=$(nslookup ${1#*@} | sed '/::/d' | sed \
    3.18 - '$!d;s/.*: \([^ ]*\).*/\1/') '$1=="0.0.0.0"{ print d " gw " $2 " dev " $8 }')"
    3.19 -for i in ${3/default/128.0.0.0/1 0.0.0.0/1} ; do
    3.20 -	echo "route add -net $i dev \$1"
    3.21 -done > $ipupd/pppnc$$
    3.22 -[ "$3" ] && echo "route add $extra" >> $ipupd/pppnc$$
    3.23 -chmod +x $ipupd/pppnc$$
    3.24 -$ppp noipdefault pty "nc -u $1 ${2:-$port}" ipparam pppnc$$
    3.25 -[ "$3" ] && route del $extra
    3.26 -rm -f $ipupd/pppnc$$