aboutsummaryrefslogtreecommitdiffstats
path: root/roles/space_server/templates/radius/getusers.sh.j2
blob: e6413d1e1690dc8106278b9fe2cbb818bfb72eb9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

set -e

outfile='/etc/raddb/mods-config/files/authorize'
tmpfile="$(mktemp /tmp/getusers.XXXXXXXX)"
cleanup() {
  rm -f "$tmpfile"
}
trap cleanup EXIT SIGINT SIGTERM

curl -s -o "$tmpfile" '{{ radius_passwords.download_url }}'
if ! diff -q "$tmpfile" "$outfile" >/dev/null; then
  install -m0640 "$tmpfile" "$outfile"
  systemctl restart radiusd.service
fi