change sh to bash to support source on all distributions

This commit is contained in:
grizzly 2025-07-14 09:55:32 -04:00
parent 2fbec4da69
commit 706c29e480

View file

@ -1,4 +1,4 @@
#!/usr/bin/sh
#!/usr/bin/bash
# Collects and logs data from the OpenShipData API and the OSM API
#
source ./secrets
@ -23,7 +23,7 @@ country=$(echo "$osm_response" | jq --raw-output .address.country)
echo "La ville la plus proche est $town dans la province de $province, $country"
curl -s -d "Donnees collectes" $NTFY_ENDPOINT
#curl -s -d "Donnees collectes" $NTFY_ENDPOINT
# store values in file
if ! [ -e "$DATA_FILE" ] ; then
@ -36,7 +36,7 @@ if ! [ -w "$DATA_FILE" ] ; then
exit 1
fi
timestamp=$(date)
timestamp=$(date -u +"%Y-%m-%d %H:%M:%S UTC")
echo "\"$timestamp\",$lat,$lon,$bearing,$speed,\"$town\",\"$province\",\"$country\"" >> $DATA_FILE
exit 0