openwebrx-clone/docker/scripts/run.sh
2021-02-06 18:15:55 +01:00

32 lines
711 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
mkdir -p /etc/openwebrx/
mkdir -p /tmp/openwebrx/
if [[ ! -f /etc/openwebrx/config_webrx.py ]] ; then
sed 's/temporary_directory = "\/tmp"/temporary_directory = "\/tmp\/openwebrx"/' < "/opt/openwebrx/config_webrx.py" > "/etc/openwebrx/config_webrx.py"
fi
if [[ ! -f /etc/openwebrx/bands.json ]] ; then
cp bands.json /etc/openwebrx/
fi
if [[ ! -f /etc/openwebrx/bookmarks.json ]] ; then
cp bookmarks.json /etc/openwebrx/
fi
if [[ ! -f /etc/openwebrx/openwebrx.conf ]] ; then
cp openwebrx.conf /etc/openwebrx/
fi
_term() {
echo "Caught signal!"
kill -TERM "$child" 2>/dev/null
}
trap _term SIGTERM SIGINT
python3 openwebrx.py $@ &
child=$!
wait "$child"