diff options
author | John Crispin <blogic@openwrt.org> | 2014-06-02 12:44:36 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2014-06-02 12:44:36 +0000 |
commit | b9907f1565b10bf492bde2892deed815db6b9a0f (patch) | |
tree | 25ba53ede2e85b24a467fa6d09a64ac27f961604 /package/network | |
parent | e12da3b22180f881d3b861766ddc77275330b093 (diff) | |
download | upstream-b9907f1565b10bf492bde2892deed815db6b9a0f.tar.gz upstream-b9907f1565b10bf492bde2892deed815db6b9a0f.tar.bz2 upstream-b9907f1565b10bf492bde2892deed815db6b9a0f.zip |
ppp: allow to set PPP interface name via config
allows to set PPP interface name manually via new
network interface option pppname.
If not set, default naming will be used (e.g. pppoe-eth0)
Signed-off-by: Ulrich Weber <uw@ocedo.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40933 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/network')
-rwxr-xr-x | package/network/services/ppp/files/ppp.sh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/package/network/services/ppp/files/ppp.sh b/package/network/services/ppp/files/ppp.sh index 882440900b..4447d061a7 100755 --- a/package/network/services/ppp/files/ppp.sh +++ b/package/network/services/ppp/files/ppp.sh @@ -19,12 +19,13 @@ ppp_generic_init_config() { proto_config_add_boolean ipv6 proto_config_add_boolean authfail proto_config_add_int mtu + proto_config_add_string pppname } ppp_generic_setup() { local config="$1"; shift - json_get_vars ipv6 demand keepalive username password pppd_options + json_get_vars ipv6 demand keepalive username password pppd_options pppname [ "$ipv6" = 1 ] || ipv6="" if [ "${demand:-0}" -gt 0 ]; then demand="precompiled-active-filter /etc/ppp/filter demand idle $demand" @@ -33,6 +34,7 @@ ppp_generic_setup() { fi [ -n "$mtu" ] || json_get_var mtu mtu + [ -n "$pppname" ] || pppname="${proto:-ppp}-$config" local interval="${keepalive##*[, ]}" [ "$interval" != "$keepalive" ] || interval=5 @@ -41,7 +43,7 @@ ppp_generic_setup() { proto_run_command "$config" /usr/sbin/pppd \ nodetach ipparam "$config" \ - ifname "${proto:-ppp}-$config" \ + ifname "$pppname" \ ${keepalive:+lcp-echo-interval $interval lcp-echo-failure ${keepalive%%[, ]*}} \ ${ipv6:++ipv6} \ nodefaultroute \ |