30-unset-firewall 390 B

12345678910111213
  1. #!/bin/bash
  2. is_firewall_set() {
  3. local wired_device=$(ip route | awk '/default via/ { print $5; }')
  4. ip6tables -w -nvL OUTPUT | grep vpnclient_out | grep -q "${wired_device}" \
  5. && iptables -w -nvL OUTPUT | grep vpnclient_out | grep -q "${wired_device}"
  6. }
  7. if is_firewall_set; then
  8. rm -f /etc/yunohost/hooks.d/post_iptable_rules/90-vpnclient
  9. yunohost firewall reload >/dev/null
  10. fi