Improve printer installation on teacherlaptops

- Update printer list when connected via VPN
- Prevent printer removal, when logging in without a connection to the school network
This commit is contained in:
Raphael Dannecker 2024-09-08 11:27:24 +02:00
parent df50907006
commit 2c201e160e
2 changed files with 4 additions and 0 deletions

View file

@ -2,6 +2,9 @@
set -eu
## Exit if first printserver is not reachable
ping -c1 -W1 {{ printservers | first }} || exit 0
printservers="{{ printservers | join(' ') }}"
hostgroup="$(id -Gn "${HOSTNAME^^}$")"
usergroup="$(id -Gn "${SUDO_USER}")"