aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2020-06-19 11:14:11 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2020-06-19 11:14:11 -0700
commit8ad6fda72a11862138f0760f3521991be3941086 (patch)
tree77dfa80c24e1e6d2f809d9366dc9e4179ed4bb2a /bin
parentConvert to running via Docker rather than system Jekyll (diff)
downloadwww-8ad6fda72a11862138f0760f3521991be3941086.tar.gz
www-8ad6fda72a11862138f0760f3521991be3941086.tar.bz2
www-8ad6fda72a11862138f0760f3521991be3941086.zip
bin: default content for userinfo for testing
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/update-userinfo.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/bin/update-userinfo.sh b/bin/update-userinfo.sh
index 613db4b..1acf8c2 100755
--- a/bin/update-userinfo.sh
+++ b/bin/update-userinfo.sh
@@ -2,9 +2,19 @@
echo -n 'Updating LDAP user information...'
+DESTFILE=_data/userinfo.json
if [[ $(hostname -f) == *'gentoo.org'* ]] || [[ "$FORCE" == '1' ]]; then
- timeout 180 bin/userinfo-export.rb > _data/userinfo.json
+ timeout 180 bin/userinfo-export.rb > "${DESTFILE}".tmp && mv -f "${DESTFILE}".tmp "${DESTFILE}"
echo 'done.'
else
echo 'skipped (not a gentoo.org box, assuming no LDAP available, set FORCE=1 to override).'
+ if [[ ! -e "${DESTFILE}" ]]; then
+ cat >"${DESTFILE}" <<-EOF
+ {
+ "current": {},
+ "retired": {},
+ "system": {}
+ }
+ EOF
+ fi
fi