blob: a7a8b1699bf0f7fff304a4ca7e3d1a6024b6014d [file] [log] [blame]
Philipp Schrader0f5d2502022-03-08 22:44:55 -08001#!/bin/bash
2
3# This script runs after the frc971-scouting-server package is installed. This
4# script is responsible for making sure the webserver has everything it needs,
5# then starts the webserver.
6
7set -o errexit
8set -o nounset
9set -o pipefail
10
11# Create a directory for the database to live in.
12mkdir -p /var/frc971/scouting/
13
14# Create an empty The Blue Alliance configuration file.
15if [[ ! -e /var/frc971/scouting/tba_config.json ]]; then
16 echo '{}' > /var/frc971/scouting/tba_config.json
17fi
18
19# Make sure it's all usable by the user.
20chown -R www-data:www-data /var/frc971/scouting/
21
22systemctl daemon-reload
23systemctl enable scouting.service
24systemctl start scouting.service || :