running() { systemctl list-units --type=service --state=running --no-legend | wc -l; } disabled() { systemctl list-unit-files --type=service --state=disabled --no-legend | awk '{ print $1 }'; } # How many of the disabled services the answer leaves out. missing() { disabled | grep -vxFf <(tr -s ' \t' '\n' /dev/null)" != masked ]' need "systemctl is-enabled apport prints enabled" '[ "$(systemctl is-enabled apport 2>/dev/null)" = enabled ]'