forked from ooni/sysadmin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update-website.sh
39 lines (29 loc) · 1.08 KB
/
update-website.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh
SETTINGS_DIR='/home/art/sysadmin/settings/'
. $SETTINGS_DIR/config.sh
# These commands are to be run on staticiforme
##
sudo -v -u ooni
# Update the reports collected from the oonib collector
echo "Updating reports from collectors: "
for collector in `cat ${SETTINGS_DIR}/collectors.txt`; do
echo "* $collector"
rsync -avzh $collector $REPORTS_DIR
done
# Fix permissions
chmod -R 755 $REPORTS_DIR
# Generate the report list
echo "Generating the report list"
python $SYSADMIN_TOOLS_DIR/update-report-list.py $REPORTS_DIR $REPORTS_DIR/reports.yaml $REPORTS_DIR/reports.json
# Update the base website
echo "Updating the base website"
sudo -u ooni rsync -avzh $WEBSITE_DIR/ $DST_DIR/build
# Update the docs
echo "Updating the docs"
sudo -u ooni rsync -avzh $DOCS_DIR/ $DST_DIR/build/docs
# Update the reports and report lists
echo "Updating the reports and report lists"
sudo -u ooni rsync -avzh $REPORTS_DIR/* $DST_DIR/build/reports/0.1
# Publish the updated website
echo "Publishing the website"
sudo -u mirroradm /usr/local/bin/static-master-update-component ooni.torproject.org