summaryrefslogtreecommitdiffstats
path: root/core/modules/lightdm-greeter-bwlp/data/opt/openslx/scripts/systemd-download_roomplan
blob: d4dff0853811c215b98423ca4860384d28deeec0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/ash

. /opt/openslx/config
[ -z "$SLX_PVS_CONFIG_URL" ] && exit 0
UUID=$( cat /etc/system-uuid )
[ -z "$UUID" ] && exit 0

mkdir -p /opt/openslx/lightdm
DEST="/opt/openslx/lightdm/roomplan.svg"
# Download
curl -m 3 -o "${DEST}" "${SLX_PVS_CONFIG_URL}&show=svg&machineuuid=${UUID}&rotate=-1"
[ -s "$DEST" ] || exit 0 # Do nothing if it doesn't exist
# But create overriding config file if it does
mkdir -p "/etc/lightdm/qt-lightdm-greeter.conf.d"
# Make it 10- so it can be easily overridden
cat > "/etc/lightdm/qt-lightdm-greeter.conf.d/10-roomplan.conf" <<EOF
[General]
loginform-mini-icon=${DEST}
EOF
exit 0