pptpd: import from old packages

Signed-off-by: Luka Perkov <luka@openwrt.org>
This commit is contained in:
Luka Perkov
2015-05-15 02:31:19 +02:00
parent 6f43c044f1
commit 264b65a41b
8 changed files with 202 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
#debug
#logfile /tmp/pptp-server.log
auth
name "pptp-server"
lcp-echo-failure 3
lcp-echo-interval 60
default-asyncmap
mtu 1482
mru 1482
nobsdcomp
nodeflate
#noproxyarp
#nomppc
mppe required,no40,no56,stateless
require-mschap-v2
refuse-chap
refuse-mschap
refuse-eap
refuse-pap
#ms-dns 172.16.1.1
#plugin radius.so
#radius-config-file /etc/radius.conf
+5
View File
@@ -0,0 +1,5 @@
#debug
option /etc/ppp/options.pptpd
speed 115200
stimeout 10
#localip & remoteip are not needed, ip management is done by pppd
+8
View File
@@ -0,0 +1,8 @@
config service 'pptpd'
option 'enabled' '0'
option 'localip' '192.168.0.1'
option 'remoteip' '192.168.0.20-30'
config 'login'
option 'username' 'youruser'
option 'password' 'yourpass'
+58
View File
@@ -0,0 +1,58 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=60
BIN=/usr/sbin/pptpd
DEFAULT=/etc/default/$BIN
RUN_D=/var/run
PID_F=$RUN_D/$BIN.pid
CONFIG=/var/etc/pptpd.conf
CHAP_SECRETS=/var/etc/chap-secrets
setup_login() {
local section="$1"
config_get username "$section" username
config_get password "$section" password
[ -n "$username" ] || return 0
[ -n "$password" ] || return 0
echo "$username pptp-server $password *" >> $CHAP_SECRETS
}
setup_config() {
local section="$1"
config_get enabled "$section" enabled
[ "$enabled" -eq 0 ] && return 1
mkdir -p /var/etc
cp /etc/pptpd.conf $CONFIG
config_get localip "$section" localip
config_get remoteip "$section" remoteip
[ -n "$localip" ] && echo "localip $localip" >> $CONFIG
[ -n "$remoteip" ] && echo "remoteip $remoteip" >> $CONFIG
return 0
}
start_pptpd() {
[ -f $DEFAULT ] && . $DEFAULT
mkdir -p $RUN_D
for m in arc4 sha1_generic slhc crc-ccitt ppp_generic ppp_async ppp_mppe; do
insmod $m >/dev/null 2>&1
done
ln -sfn $CHAP_SECRETS /etc/ppp/chap-secrets
service_start $BIN $OPTIONS -c $CONFIG
}
start() {
config_load pptpd
setup_config pptpd || return
config_foreach setup_login login
start_pptpd
}
stop() {
service_stop $BIN
}