$(INSTALL_BIN) ./files/etc/ppp/ipv6-up $(1)/etc/ppp/
$(INSTALL_BIN) ./files/etc/ppp/ipv6-down $(1)/etc/ppp/
$(INSTALL_DATA) ./files/etc/ppp/options $(1)/etc/ppp/
- ln -sf /tmp/resolv.conf.auto $(1)/etc/ppp/resolv.conf
+ ln -sf /tmp/resolv.conf.ppp $(1)/etc/ppp/resolv.conf
endef
define Package/ppp-mod-pppoa/install
#!/bin/sh
+
. /etc/functions.sh
+. /lib/network/config.sh
+
PPP_IFACE="$1"
PPP_TTY="$2"
PPP_SPEED="$3"
uci_set_state network "$PPP_IPPARAM" gateway "$PPP_REMOTE"
local dns="$DNS1${DNS2:+ $DNS2}"
- [ -n "$dns" ] && uci_set_state network "$PPP_IPPARAM" dns "$dns"
+ [ -n "$dns" ] && add_dns "$PPP_IPPARAM" $dns
}
+
[ -z "$PPP_IPPARAM" ] || env -i ACTION="ifup" INTERFACE="$PPP_IPPARAM" DEVICE="$PPP_IFACE" PROTO=ppp /sbin/hotplug-call "iface"
[ -d /etc/ppp/ip-up.d ] && {
local proto
config_get proto "$cfg" proto
- local ifname
- config_get ifname "$cfg" ifname
-
- local link="$proto-${ifname#$proto-}"
+ local link="$proto-$cfg"
[ -f "/var/run/ppp-${link}.pid" ] && {
local pid="$(head -n1 /var/run/ppp-${link}.pid 2>/dev/null)"
local try=0
rm -f "/var/run/ppp-${link}.pid"
}
+ remove_dns "$cfg"
+
local lock="/var/lock/ppp-$link"
[ -f "$lock" ] && lock -u "$lock"
}
local peerdns
config_get_bool peerdns "$cfg" peerdns $peer_default
- if [ "$peerdns" -eq 1 ] || [ ! -e /tmp/resolv.conf.auto ]; then
- echo -n "" > /tmp/resolv.conf.auto
- fi
-
[ "$peerdns" -eq 1 ] && {
peerdns="usepeerdns"
} || {
peerdns=""
- for dns in $dns; do
- echo "nameserver $dns" >> /tmp/resolv.conf.auto
- done
+ add_dns "$cfg" $dns
}
local demand
local demandargs
[ "$demand" -eq 1 ] && {
demandargs="precompiled-active-filter /etc/ppp/filter demand idle"
- [ "$has_dns" -eq 0 ] && \
- echo "nameserver 1.1.1.1" > /tmp/resolv.conf.auto
+ [ "$has_dns" -eq 0 ] && add_dns "$cfg" 1.1.1.1
} || {
demandargs="persist"
}