From e67eee4a81ed768f7a82ca9d894d89abec315bf3 Mon Sep 17 00:00:00 2001 From: bedweb Date: Tue, 30 Sep 2025 09:16:33 +0200 Subject: [PATCH] 2 --- ais-runner | 8 ++++++++ ais_query.sh | 7 ++++--- 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 ais-runner diff --git a/ais-runner b/ais-runner new file mode 100644 index 0000000..2947d11 --- /dev/null +++ b/ais-runner @@ -0,0 +1,8 @@ +#!/sbin/openrc-run +name="ais-runner" +description="ais runner" +command="/root/ais/ais_query.sh" +command_background=true +pidfile="/run/ais-runner.pid" +output_log="/var/log/${RC_SVCNAME}.log" +error_log="/var/log/${RC_SVCNAME}.err" diff --git a/ais_query.sh b/ais_query.sh index f1223fe..b958398 100755 --- a/ais_query.sh +++ b/ais_query.sh @@ -11,7 +11,7 @@ WEBSOCKET_URL="wss://stream.aisstream.io/v0/stream" # Default bounding box (worldwide coverage) # Format: [[lat1, lon1], [lat2, lon2]] # Current setting covers the entire world -BOUNDING_BOX='[[[-90, -180], [90, 180]]]' +BOUNDING_BOX='[[[-90,0],[5,60]]]' # Optional: Filter by specific ship MMSI numbers (up to 50) # Leave empty for all ships @@ -22,8 +22,9 @@ SHIP_MMSI_FILTER='["227397210"]' MESSAGE_TYPE_FILTER='["PositionReport"]' # Output file for logging (optional) -DateFichier=`date +"%Y%m%d-%H%M%S"` -OUTPUT_FILE="raw_ais_"$DateFichier".log" +DateFichier=$(date +"%Y%m%d-%H%M%S") +dir=$(dirname $0) +OUTPUT_FILE="$dir/raw_ais_$DateFichier.log" # Function to display usage information show_usage() {