#!/bin/sh is_started() { /sbin/iptables -L -n \ | grep --quiet --extended-regexp "^(DROP\s+(udp|17)|ACCEPT\s+(icmp|1))\s+--\s+0\.0\.0\.0\/0\s+0\.0\.0\.0\/0\s*$" } return_started() { echo "started" exit 0 } return_stopped() { echo "stopped" exit 1 } is_started && return_started || return_stopped