07b6a43ca5c4cbe29f905d057cdb585511968d8f
[openwrt/openwrt.git] / package / network / services / ppp / files / lib / netifd / ppp6-up
1 #!/bin/sh
2 PPP_IPPARAM="$6"
3
4 . /lib/netifd/netifd-proto.sh
5 proto_init_update "$IFNAME" 1 1
6 proto_set_keep 1
7 [ -n "$PPP_IPPARAM" ] && {
8 [ -n "$LLLOCAL" ] && proto_add_ipv6_address "$LLLOCAL" 128
9 }
10 proto_send_update "$PPP_IPPARAM"
11
12 [ -d /etc/ppp/ip-up.d ] && {
13 for SCRIPT in /etc/ppp/ip-up.d/*
14 do
15 [ -x "$SCRIPT" ] && "$SCRIPT" "$@"
16 done
17 }
18
19 if [ -n "$AUTOIPV6" ]; then
20 json_init
21 json_add_string name "${PPP_IPPARAM}_6"
22 json_add_string ifname "@$PPP_IPPARAM"
23 json_add_string proto "dhcpv6"
24 [ -n "$EXTENDPREFIX" ] && json_add_string extendprefix 1
25 [ -n "$IP6TABLE" ] && json_add_string ip6table $IP6TABLE
26 json_close_object
27 ubus call network add_dynamic "$(json_dump)"
28 fi