ppp6-up 735 B

1234567891011121314151617181920212223242526272829
  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. json_init
  18. json_add_string name "${PPP_IPPARAM}_6"
  19. json_add_string ifname "@$PPP_IPPARAM"
  20. json_add_string proto "dhcpv6"
  21. [ -n "$EXTENDPREFIX" ] && json_add_string extendprefix 1
  22. [ -n "$IP6TABLE" ] && json_add_string ip6table $IP6TABLE
  23. [ -n "$PEERDNS" ] && json_add_boolean peerdns $PEERDNS
  24. json_close_object
  25. ubus call network add_dynamic "$(json_dump)"
  26. fi