30 lines
524 B
Bash
30 lines
524 B
Bash
#!/usr/bin/env bash
|
|
|
|
. /app/utils.sh
|
|
|
|
sleep_time=3600
|
|
sleep_time_fail=60
|
|
|
|
function wait() {
|
|
delay="$1"
|
|
echo "💤 Sleeping $delay seconds..."
|
|
sleep $delay
|
|
}
|
|
|
|
while :
|
|
do
|
|
regions="europe/great-britain"
|
|
style=""
|
|
first_run="true"
|
|
|
|
[[ -n "$OSMGARMIN_REGIONS" ]] && regions="$OSMGARMIN_REGIONS"
|
|
[[ -n "$OSMGARMIN_STYLE" ]] && style="$OSMGARMIN_STYLE"
|
|
|
|
/app/build-gmap.sh "$regions" "$style"
|
|
|
|
if [[ $? == 0 ]]; then
|
|
wait $sleep_time
|
|
else
|
|
wait $sleep_time_fail
|
|
fi
|
|
done |