" <<< "$mast_result" >/dev/null 2>&1; then
+ configure_both "MASTODON_NAME" "$(jq -r '.acct' <<< "$mast_result")"
+ fi
if chk_enabled "${PF_MASTODON,,}"; then
configure_planefence "MASTODON_ACCESS_TOKEN" "$MASTODON_ACCESS_TOKEN"
configure_planefence "MASTODON_SERVER" "$MASTODON_SERVER"
@@ -354,6 +369,12 @@ configure_planefence "PF_MOTD" "\"$PF_MOTD\""
configure_planealert "PA_MOTD" "\"$PA_MOTD\""
#
#--------------------------------------------------------------------------------
+# Set TRACKSERVICE and TRACKLIMIT for Planefence and plane-alert.
+[[ -n "$PF_TRACKSERVICE" ]] && configure_planefence "TRACKSERVICE" "$PF_TRACKSERVICE" || configure_planefence "TRACKSERVICE" "globe.adsbexchange.com"
+[[ -n "$PA_TRACKSERVICE" ]] && configure_planealert "TRACKSERVICE" "$PA_TRACKSERVICE" || true
+[[ -n "$PA_TRACKLIMIT" ]] && configure_planealert "TRACKLIMIT" "$PA_TRACKLIMIT" || true
+#
+#--------------------------------------------------------------------------------
# Last thing - save the date we processed the config to disk. That way, if ~/.planefence/planefence.conf is changed,
# we know that we need to re-run this prep routine!
diff --git a/rootfs/usr/share/planefence/send-discord-alert.py b/rootfs/usr/share/planefence/send-discord-alert.py
index 344f55bf..14844471 100755
--- a/rootfs/usr/share/planefence/send-discord-alert.py
+++ b/rootfs/usr/share/planefence/send-discord-alert.py
@@ -4,10 +4,13 @@
#
# Usage: ./send-discord-alert.py
#
-# Copyright 2022 Ramon F. Kolb - licensed under the terms and conditions
+# Copyright 2022-2024 Ramon F. Kolb, kx1t
+# Copyright 2022 Justin DiPierro
+#
+# Licensed under the terms and conditions
# of GPLv3. The terms and conditions of this license are included with the Github
# distribution of this package, and are also available here:
-# https://github.com/kx1t/planefence/
+# https://github.com/sdr-enthusiasts/planefence/
#
# The package contains parts of, and modifications or derivatives to the following:
# Dump1090.Socket30003 by Ted Sluis: https://github.com/tedsluis/dump1090.socket30003
@@ -63,6 +66,29 @@ def process_alert(config, plane):
name = plane['tail_num']
if plane["airline"] != "":
name = plane['airline']
+
+ try:
+ if config['PF_TRACKSERVICE'] == "":
+ trackservice="globe.adsbexchange.com"
+ trackname="AdsbExchange"
+ else:
+ trackservice=config['PF_TRACKSERVICE']
+ trackname=config['PF_TRACKSERVICE'].replace('https://','')
+ trackname=trackname.replace('http://','')
+ trackname=trackname.replace('www.','')
+ trackname=trackname.replace('globe.','')
+ trackname=trackname.replace('radar.','')
+ trackname=trackname.replace('tar1090.','')
+ trackname=trackname.replace('.com','')
+ trackname=trackname.replace('.org','')
+ trackname=trackname.replace('.net','')
+ trackname=trackname.replace('/tar1090','')
+ trackname=trackname.replace('/map','')
+ trackname=trackname.replace('/radar','')
+ trackname=trackname.replace('/','')
+ except:
+ trackservice="globe.adsbexchange.com"
+ trackname="AdsbExchange"
fa_link = pf.flightaware_link(plane['icao'], plane['tail_num'])
@@ -70,7 +96,7 @@ def process_alert(config, plane):
config["DISCORD_FEEDER_NAME"],
config["PF_DISCORD_WEBHOOKS"],
f"{name} is overhead at {pf.altitude_str(config, plane['alt'])}",
- f"[Track on ADS-B Exchange]({plane['adsbx_url']})")
+ f"[Track on {trackname}]({plane['adsbx_url'].replace('globe.adsbexchange.com',trackservice)})")
pf.attach_media(config, "PF", plane, webhooks, embed)
diff --git a/rootfs/usr/share/planefence/send_discord b/rootfs/usr/share/planefence/send_discord
index e3a27b6f..3b6b65b7 100755
--- a/rootfs/usr/share/planefence/send_discord
+++ b/rootfs/usr/share/planefence/send_discord
@@ -1,7 +1,7 @@
#!/command/with-contenv bash
#shellcheck shell=bash disable=SC2015,SC2164,SC1090,SC2154,SC1091
#---------------------------------------------------------------------------------------------
-# Copyright (C) 2022-2023, Ramon F. Kolb (kx1t)
+# Copyright (C) 2022-2024, Ramon F. Kolb (kx1t)
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
diff --git a/rootfs/usr/share/planefence/send_mastodon b/rootfs/usr/share/planefence/send_mastodon
index ad722aec..52f8d1ca 100755
--- a/rootfs/usr/share/planefence/send_mastodon
+++ b/rootfs/usr/share/planefence/send_mastodon
@@ -1,7 +1,7 @@
#!/command/with-contenv bash
#shellcheck shell=bash disable=SC2015,SC2164,SC1090,SC1091
#---------------------------------------------------------------------------------------------
-# Copyright (C) 2022-2023, Ramon F. Kolb (kx1t)
+# Copyright (C) 2022-2024, Ramon F. Kolb (kx1t)
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
diff --git a/rootfs/usr/share/planefence/stage/pa_query.php b/rootfs/usr/share/planefence/stage/pa_query.php
index 51d31914..7a1b80e6 100644
--- a/rootfs/usr/share/planefence/stage/pa_query.php
+++ b/rootfs/usr/share/planefence/stage/pa_query.php
@@ -50,7 +50,7 @@
echo "will return records of tail N141NE, N142NE, N143NE, and that have a timestamp that contains 2021/12/20 - 2021/21/29.
";
echo "
";
echo "Note that the date range is limited to the data available to Plane-Alert.
";
- echo "(C)opyright 2021 by kx1t, available under GPL3 as defined at the PlaneFence repository at GitHub.
";
+ echo "(C)opyright 2021-2024 by kx1t, available under GPL3 as defined at the PlaneFence repository at GitHub.
";
echo "
" . $hex . $tail . $name . $equipment . $timestamp . $call . $lat . $lon;
echo "