2
0
Fork 0

revert (partial) bcf7ff90d8

main
Ducky 2023-10-02 16:45:34 +01:00
parent bcf7ff90d8
commit 70c00eadc2
2 changed files with 23 additions and 55 deletions

View File

@ -0,0 +1,23 @@
#!/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
/app/build-gmap.sh "$OSMGARMIN_REGIONS" "$OSMGARMIN_STYLE"
if [[ $? == 0 ]]; then
wait $sleep_time
else
wait $sleep_time_fail
fi
done

View File

@ -1,55 +0,0 @@
#!/usr/bin/env bash
. /app/utils.sh
command="$1"
arguments="${@:2}"
me_filename="$(basename "$(realpath -s "$0")")"
if [[ "$commnad" == "" ]]; then
die "No command given. See '$me_command help'"
fi
function exec_daemon() {
sleep_time=3600
sleep_time_fail=60
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
}
function exec_help() {
echo "$me_filename
Usage:
$me_filename daemon / $me_filename
Start daemon to build maps periodically
$me_filename help
Output this usage text
"
exit 0
}
case "$command" in
""|"daemon") exec_daemon ;;
"help") exec_help ;;
*)
die "Command '$command' not recognized. See '$me_filename help' for help"
;;
esac