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.

19 lines
499 B

  1. #!/bin/sh
  2. DEVICE=${DEVICE:-$(/sbin/uci -p /var/state get network."$INTERFACE".ifname)}
  3. case "$ACTION" in
  4. ifup)
  5. if [ "$INTERFACE" = "lan" ]; then
  6. /usr/sbin/shorewall start
  7. elif [ "${INTERFACE:0:3}" = "wan" ] &&
  8. [ "${INTERFACE:$((${#INTERFACE}-2)):2}" != "_6" ]; then
  9. /etc/shorewall/state/firewall enable "$DEVICE"
  10. fi
  11. ;;
  12. ifdown)
  13. if [ "${INTERFACE:0:3}" = "wan" ]; then
  14. /etc/shorewall/state/firewall disable "$DEVICE"
  15. fi
  16. ;;
  17. esac