wok-current view ppp/stuff/pppnc-server @ rev 17736

prelink: force libpthread link
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Mar 06 12:45:18 2015 +0100 (2015-03-06)
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$$