Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ampledata committed Jun 19, 2024
1 parent bd4bbc7 commit 4141b38
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deb-build-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
with:
name: artifact-deb
path: |
*.deb
./*.deb
- name: Create Release
id: create_release
Expand Down
10 changes: 9 additions & 1 deletion debian/DEBIAN/postinst
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
#!/bin/bash

echo "\033[36m adsbxfeed postinst `date +"%s"` \033[39m"
echo "adsbxfeed postinst"

UUID_FILE="/etc/AryaOS/UUID.txt"

if [ ! -f $UUID_FILE ]; then
mkdir -p /etc/AryaOS
echo "$UUID_FILE doesn't exist, initializing."
uuidgen > $UUID_FILE
fi

systemctl enable adsbxfeed
systemctl start adsbxfeed
Expand Down
2 changes: 1 addition & 1 deletion debian/DEBIAN/prerm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

echo "\033[36m adsbxfeed prerm `date +"%s"` \033[39m"
echo "adsbxfeed prerm"

systemctl disable adsbxfeed
systemctl stop adsbxfeed
Expand Down
Empty file removed debian/boot/.gitignore
Empty file.
25 changes: 25 additions & 0 deletions debian/boot/adsbxfeed.txt → debian/etc/AryaOS/adsbxfeed.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
# adsbxfeed.conf from https://github.com/snstac/adsbxfeed
#
# Copyright Sensors & Signals LLC https://www.snstac.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

RUN_DIR="/run/adsbxfeed"
UUID_FILE="/etc/AryaOS/UUID.txt"

INPUT="127.0.0.1:30005"
REDUCE_INTERVAL="0.5"

Expand All @@ -18,12 +38,17 @@ RESULTS="--results beast,connect,127.0.0.1:30104"
RESULTS2="--results basestation,listen,31003"
RESULTS3="--results beast,listen,30157"
RESULTS4="--results beast,connect,127.0.0.1:30154"

# add --privacy between the quotes below to disable having the feed name shown on the mlat map
# (position is never shown accurately no matter the settings)
PRIVACY=""

INPUT_TYPE="dump1090"

MLATSERVER="feed.adsbexchange.com:31090"

TARGET="--net-connector feed1.adsbexchange.com,30004,beast_reduce_out,feed2.adsbexchange.com,64004"

NET_OPTIONS="--net-heartbeat 60 --net-ro-size 1280 --net-ro-interval 0.2 --net-ro-port 0 --net-sbs-port 0 --net-bi-port 30154 --net-bo-port 0 --net-ri-port 0 --write-json-every 1"

JSON_OPTIONS="--max-range 450 --json-location-accuracy 2 --range-outline-hours 24"
19 changes: 18 additions & 1 deletion debian/lib/systemd/system/adsbxfeed.service
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# adsbxfeed.service from https://github.com/snstac/adsbxfeed
#
# Copyright Sensors & Signals LLC https://www.snstac.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

[Unit]
Description=adsbxfeed
Wants=network.target
Expand All @@ -6,7 +23,7 @@ After=network.target
[Service]
User=adsbxfeed
RuntimeDirectory=adsbxfeed
ExecStart=/usr/local/bin/adsbxfeed.sh
ExecStart=/usr/bin/adsbxfeed.sh
Type=simple
Restart=always
RestartSec=30
Expand Down
53 changes: 38 additions & 15 deletions debian/usr/bin/adsbxfeed.sh
Original file line number Diff line number Diff line change
@@ -1,33 +1,56 @@
#!/bin/bash
# adsbxfeed.sh from https://github.com/snstac/adsbxfeed
#
# Copyright Sensors & Signals LLC https://www.snstac.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

CONF_FILE="/etc/AryaOS/adsbxfeed.conf"

if [ -f $CONF_FILE ]; then
# shellcheck source=SCRIPTDIR/../../etc/AryaOS/adsbxfeed.conf
. $CONF_FILE
else
echo "$CONF_FILE doesn't exist, exiting."
exit 1
fi

source /boot/adsbxfeed.txt

if ! [[ -d /run/adsbxfeed/ ]]; then
mkdir -p /run/adsbxfeed
if ! [[ -d $RUN_DIR ]]; then
mkdir -p "$RUN_DIR"
fi

if [[ -z $INPUT ]]; then
INPUT="127.0.0.1:30005"
fi

INPUT_IP=$(echo $INPUT | cut -d: -f1)
INPUT_PORT=$(echo $INPUT | cut -d: -f2)
INPUT_IP=$(echo "$INPUT" | cut -d: -f1)
INPUT_PORT=$(echo "$INPUT" | cut -d: -f2)
SOURCE="--net-connector $INPUT_IP,$INPUT_PORT,beast_in,silent_fail"

if [[ -z $UAT_INPUT ]]; then
UAT_INPUT="127.0.0.1:30978"
fi

UAT_IP=$(echo $UAT_INPUT | cut -d: -f1)
UAT_PORT=$(echo $UAT_INPUT | cut -d: -f2)
UAT_IP=$(echo "$UAT_INPUT" | cut -d: -f1)
UAT_PORT=$(echo "$UAT_INPUT" | cut -d: -f2)
UAT_SOURCE="--net-connector $UAT_IP,$UAT_PORT,uat_in,silent_fail"


exec /usr/bin/readsb --net --net-only --quiet \
--write-json /run/adsbxfeed \
--net-beast-reduce-interval $REDUCE_INTERVAL \
$TARGET $NET_OPTIONS \
--write-json "$RUN_DIR" \
--net-beast-reduce-interval "$REDUCE_INTERVAL" \
"$TARGET" "$NET_OPTIONS" \
--lat "$LATITUDE" --lon "$LONGITUDE" \
$UUID_FILE $JSON_OPTIONS \
$UAT_SOURCE \
$SOURCE \
"$UUID_FILE" "$JSON_OPTIONS" \
"$UAT_SOURCE" \
"$SOURCE" \

0 comments on commit 4141b38

Please sign in to comment.