You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
393 B

  1. #!/bin/sh
  2. #
  3. ban_pidfile="/var/run/banip.pid"
  4. ban_enabled="$(/etc/init.d/banip enabled; printf "%u" "${?}")"
  5. if [ "${ban_enabled}" = "0" ] && [ "${ACTION}" = "add" ] && [ -n "${INTERFACE}" ]
  6. then
  7. ban_ifaces="$(uci_get banip global ban_ifaces)"
  8. if [ ! -s "${ban_pidfile}" ] && [ -n "$(printf "%s\n" "${ban_ifaces}" | grep -F "${INTERFACE}")" ]
  9. then
  10. /etc/init.d/banip refresh
  11. fi
  12. fi
  13. exit 0