wok view ppp/stuff/pppnc-server @ rev 17180

virtualbox-ose;strigi;libjreen;qca;qtractor: remove meta "qt4" depend; libQtCore:pthreads required
author Xander Ziiryanoff <psychomaniak@xakep.ru>
date Sat Sep 27 21:53:42 2014 +0200 (2014-09-27)
parents
children 56c606af68bc
line source
1 #!/bin/sh
3 ppp="/usr/sbin/pppd local noauth nodetach"
4 port=1111
5 ipupd=/etc/ppp/ip-up.d
7 case "$0" in
8 *server) # Usage: pppnc-server [port] [localip:remoteip]
9 n=10.$(($$%256)).$(($$/256))
10 exec $ppp ${2:-$n.1:$n.2} passive proxyarp pty "nc -lp ${1:-$port}"
11 esac
13 [ -z "$1" ] && echo "Usage: $0 serverip [port] [routes]" && exit 1
14 for i in $3 ; do
15 echo "route add -net $i dev \$1"
16 done > $ipupd/pppnc$$
17 chmod +x $ipupd/pppnc$$
18 $ppp noipdefault pty "nc $1 ${2:-$port}" ipparam pppnc$$
19 rm -f $ipupd/pppnc$$