-
-
Notifications
You must be signed in to change notification settings - Fork 290
Expand file tree
/
Copy pathconfigure-janus
More file actions
executable file
·43 lines (38 loc) · 1003 Bytes
/
configure-janus
File metadata and controls
executable file
·43 lines (38 loc) · 1003 Bytes
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
40
41
42
43
#!/bin/bash
#
# Writes the main Janus config file. The config file is based on the config
# template, and it depends on the values found in /home/tinypilot/settings.yml.
# Note that you have to restart both the Janus and uStreamer systemd services
# after running this script, in order to effectuate the config changes.
# Exit on unset variable.
set -u
# Exit on first error.
set -e
print_help() {
cat << EOF
Usage: ${0##*/} [--help]
(Re-)writes the Janus configuration, based on the settings.yml file.
--help Display this help and exit.
EOF
}
# Parse command-line arguments.
while (( "$#" > 0 )); do
case "$1" in
--help)
print_help
exit
;;
*)
>&2 print_help
exit 1
esac
done
# Generate and write config file from template.
pushd /opt/tinypilot
. venv/bin/activate
runuser tinypilot \
--command 'PYTHONPATH=/opt/tinypilot/app ./scripts/render-template' \
< /usr/share/tinypilot/templates/janus.jcfg.j2 \
> /etc/janus/janus.jcfg
deactivate
popd