2023-10-02 17:45:34 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
. /app/utils.sh
|
|
|
|
|
|
|
|
sleep_time=3600
|
|
|
|
sleep_time_fail=60
|
|
|
|
|
2023-10-03 00:40:52 +02:00
|
|
|
[[ -n $OSMGARMIN_DAEMON_SLEEP ]] && sleep_time=$OSMGARMIN_DAEMON_SLEEP
|
|
|
|
|
2023-10-02 17:45:34 +02:00
|
|
|
function wait() {
|
|
|
|
delay="$1"
|
|
|
|
echo "💤 Sleeping $delay seconds..."
|
|
|
|
sleep $delay
|
|
|
|
}
|
|
|
|
|
|
|
|
while :
|
|
|
|
do
|
|
|
|
/app/build-gmap.sh "$OSMGARMIN_REGIONS" "$OSMGARMIN_STYLE"
|
|
|
|
|
|
|
|
if [[ $? == 0 ]]; then
|
|
|
|
wait $sleep_time
|
|
|
|
else
|
|
|
|
wait $sleep_time_fail
|
|
|
|
fi
|
|
|
|
done
|