wok view ppp/stuff/pppnc-server @ rev 16637
ruby-dev: add gem
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon May 12 10:25:37 2014 +0000 (2014-05-12) |
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$$