mirror of
https://github.com/hak5/wifipineapple-openwrt.git
synced 2025-10-29 16:57:19 +00:00
rewrite of the network scripts and configuration
git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4323 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
@@ -31,8 +31,8 @@ endef
|
||||
define Package/pptp/install
|
||||
install -d -m0755 $(1)/etc/ppp
|
||||
install -m0644 ./files/options.pptp $(1)/etc/ppp/
|
||||
install -d -m0755 $(1)/sbin
|
||||
install -m0755 ./files/ifup.pptp $(1)/sbin/
|
||||
install -d -m0755 $(1)/lib/network
|
||||
install -m0755 ./files/pptp.sh $(1)/lib/network/
|
||||
install -d -m0755 $(1)/usr/sbin
|
||||
install -m0755 $(PKG_BUILD_DIR)/pptp $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
#!/bin/sh
|
||||
[ $# = 0 ] && { echo " $0 <group>"; exit; }
|
||||
. /etc/config/network
|
||||
type=$1
|
||||
|
||||
eval "proto=\"\${${type}_proto}\""
|
||||
[ "$proto" = "pptp" ] || {
|
||||
echo "$0: ${type}_proto isn't pptp"
|
||||
exit
|
||||
}
|
||||
|
||||
mkdir -p /var/lock
|
||||
|
||||
for module in slhc ppp_generic ppp_async ip_gre; do
|
||||
/sbin/insmod $module 2>&- >&-
|
||||
done
|
||||
|
||||
KEEPALIVE=${ppp_redialperiod:+lcp-echo-interval $ppp_redialperiod lcp-echo-failure 5}
|
||||
case "$ppp_demand" in
|
||||
on|1|enabled)
|
||||
DEMAND=${ppp_idletime:+demand idle $ppp_idletime}
|
||||
[ -f /etc/ppp/filter ] && DEMAND=${DEMAND:+precompiled-active-filter /etc/ppp/filter $DEMAND}
|
||||
;;
|
||||
*) DEMAND="persist";;
|
||||
esac
|
||||
MTU=${ppp_mtu:-1452}
|
||||
|
||||
[ "$pptp_proto" = "static" ] || pptp_proto="dhcp"
|
||||
do_ifup $pptp_proto $type
|
||||
|
||||
/usr/sbin/pppd \
|
||||
pty "/usr/sbin/pptp $pptp_server_ip --loglevel 0 --nolaunchpppd" \
|
||||
file /etc/ppp/options.pptp \
|
||||
connect /bin/true \
|
||||
usepeerdns \
|
||||
defaultroute \
|
||||
replacedefaultroute \
|
||||
linkname "$type" \
|
||||
ipparam "$type" \
|
||||
user "$ppp_username" \
|
||||
password "$ppp_passwd" \
|
||||
mtu $MTU mru $MTU \
|
||||
$DEMAND \
|
||||
$KEEPALIVE
|
||||
|
||||
22
package/pptp/files/pptp.sh
Normal file
22
package/pptp/files/pptp.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
scan_pppoe() {
|
||||
scan_ppp "$@"
|
||||
}
|
||||
|
||||
setup_interface_pppoe() {
|
||||
local iface="$1"
|
||||
local config="$2"
|
||||
|
||||
config_get device "$config" device
|
||||
|
||||
for module in slhc ppp_generic ppp_async ip_gre; do
|
||||
/sbin/insmod $module 2>&- >&-
|
||||
done
|
||||
setup_interface "$iface" "$config" "dhcp"
|
||||
|
||||
config_get mtu "$cfg" mtu
|
||||
mtu=${mtu:-1452}
|
||||
start_pppd "$config" \
|
||||
plugin rp-pppoe.so \
|
||||
mtu $mtu mru $mtu \
|
||||
"nic-$device"
|
||||
}
|
||||
Reference in New Issue
Block a user