#!/usr/bin/bash if [[ "${PAM_USER}" =~ -exam$ ]]; then systemctl start firewalld.service elif ! (users | grep -q -- "-exam"); then systemctl stop firewalld.service fi