ppp6-up 833 B

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