#!/bin/bash if ! systemctl --quiet is-active "$1" then echo "CRITICAL - systemd unit $1 not active" exit 2 else echo OK exit 0 fi