This repository has been archived on 2019-12-12. You can view files and clone it, but cannot push or open issues/pull-requests.
2015-07-26 06:23:01 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2015-10-20 21:49:20 +00:00
|
|
|
# Feed JSON/tdp output from "stats" into mustache template to generate
|
|
|
|
# tilde.town homepage. Invoke periodically from crontab.
|
2015-07-26 06:23:01 +00:00
|
|
|
|
2015-10-20 21:49:20 +00:00
|
|
|
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
|
2015-07-26 06:23:01 +00:00
|
|
|
|
2015-10-20 21:49:20 +00:00
|
|
|
template=/usr/local/tildetown-scripts/tildetown/templates/frontpage.html
|
|
|
|
mustache=/usr/local/tildetown-scripts/tildetown/mustache.py
|
|
|
|
input_path=/var/www/tilde.town/tilde.json
|
2015-07-26 06:23:01 +00:00
|
|
|
output_path=/var/www/tilde.town/index.html
|
|
|
|
|
2015-10-20 21:49:20 +00:00
|
|
|
if [ ! -f "$input_path" ]; then
|
|
|
|
print "homepage generation needs missing $input_path"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
exec /usr/local/virtualenvs/tildetown/bin/python "$mustache" "$template" < "$input_path" > "$output_path"
|