40-vpnclient-unset-ipv6 322 B

1234567891011
  1. #!/bin/bash
  2. is_ip6addr_set() {
  3. local ip6_addr=${1}
  4. ip address show dev tun0 2> /dev/null | grep -q "${ip6_addr}/"
  5. }
  6. ip6_addr=$(yunohost app setting "vpnclient" "ip6_addr")
  7. if [[ -n "${ip6_addr}" ]] && [[ "${ip6_addr}" != none ]] && is_ip6addr_set "${ip6_addr}"; then
  8. ip address delete "${ip6_addr}/64" dev tun0
  9. fi