2019-01-13 21:04:29 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
2019-12-15 17:28:35 +00:00
|
|
|
mkdir -p /etc/openwebrx/
|
|
|
|
mkdir -p /tmp/openwebrx/
|
2019-12-14 18:05:22 +00:00
|
|
|
if [[ ! -f /etc/openwebrx/config_webrx.py ]] ; then
|
2019-12-15 17:28:35 +00:00
|
|
|
sed 's/temporary_directory = "\/tmp"/temporary_directory = "\/tmp\/openwebrx"/' < "/opt/openwebrx/config_webrx.py" > "/etc/openwebrx/config_webrx.py"
|
2019-01-13 21:04:29 +00:00
|
|
|
fi
|
2019-12-15 17:28:35 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
|
2019-01-13 21:04:29 +00:00
|
|
|
_term() {
|
|
|
|
echo "Caught signal!"
|
|
|
|
kill -TERM "$child" 2>/dev/null
|
|
|
|
}
|
|
|
|
|
|
|
|
trap _term SIGTERM SIGINT
|
|
|
|
|
2019-06-20 12:46:04 +00:00
|
|
|
python3 openwebrx.py $@ &
|
2019-01-13 21:04:29 +00:00
|
|
|
|
|
|
|
child=$!
|
|
|
|
wait "$child"
|
|
|
|
|