Separate exam-mode stuff in own role
This commit is contained in:
parent
43157dd810
commit
3d01394820
13 changed files with 493 additions and 472 deletions
|
@ -1,16 +0,0 @@
|
|||
#!/usr/bin/bash
|
||||
|
||||
# exit if not running as root. Because other user don't have privileges to start/stop firewalld.
|
||||
[[ "${UID}" -eq "0" ]] || exit 0
|
||||
|
||||
if [[ "${PAM_USER}" =~ -exam$ ]]; then
|
||||
systemctl start firewalld.service
|
||||
if systemctl is-enabled --quiet libvirtd.service; then
|
||||
systemctl restart libvirtd.service
|
||||
fi
|
||||
elif ! (users | grep -q -- "-exam"); then
|
||||
systemctl stop firewalld.service
|
||||
if systemctl is-enabled --quiet libvirtd.service; then
|
||||
systemctl restart libvirtd.service
|
||||
fi
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue