#!/usr/bin/env bash set -euo pipefail if ! command -v ufw &>/dev/null; then echo "ufw: missing" exit 1 fi if ufw status | grep -qi "Status: active"; then echo "ufw: active" exit 0 fi echo "ufw: inactive" exit 1