Skip to content

Commit

Permalink
pi setup
Browse files Browse the repository at this point in the history
Signed-off-by: Clemens Vasters <clemens@vasters.com>
  • Loading branch information
clemensv committed Jan 23, 2025
1 parent 328f86a commit 12cb881
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions mode-s/rpi_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ After=network.target
User=mode_s_kafka_bridge
WorkingDirectory=$home_dir
ExecStart=$venv_dir/bin/mode_s_kafka_bridge feed --dump1090-host $DUMP1090_HOST --dump1090-port $DUMP1090_PORT --ref-lat $ANTENNA_LAT --ref-lon $ANTENNA_LON --stationid $STATIONID \\
\${CONTENT_MODE:+--content-mode "\$CONTENT_MODE"} \\
\${CONNECTION_STRING:+--connection-string "\$CONNECTION_STRING"} \\
\${CONNECTION_STRING:- --kafka-bootstrap-servers "\$KAFKA_BOOTSTRAP_SERVERS" --kafka-topic "\$KAFKA_TOPIC" --sasl-username "\$SASL_USERNAME" --sasl-password "\$SASL_PASSWORD"}
${CONTENT_MODE:+--content-mode "$CONTENT_MODE"} \\
${CONNECTION_STRING:+--connection-string "$CONNECTION_STRING"} \\
${CONNECTION_STRING:- --kafka-bootstrap-servers "$KAFKA_BOOTSTRAP_SERVERS" --kafka-topic "$KAFKA_TOPIC" --sasl-username "$SASL_USERNAME" --sasl-password "$SASL_PASSWORD"}
Environment="STATIONID=$STATIONID"
Environment="CONTENT_MODE=$CONTENT_MODE"
Environment="KAFKA_BOOTSTRAP_SERVERS=$KAFKA_BOOTSTRAP_SERVERS"
Expand All @@ -86,6 +86,8 @@ EOF

# Function to uninstall the service
uninstall_service() {
home_dir="/home/mode_s_kafka_bridge"

# Stop and disable the service
sudo systemctl stop mode_s_kafka_bridge.service
sudo systemctl disable mode_s_kafka_bridge.service
Expand All @@ -108,6 +110,8 @@ uninstall_service() {
sudo rm -rf "$log_dir"
fi

sudo rm -rf "$home_dir"

echo "Service uninstalled."
}

Expand Down

0 comments on commit 12cb881

Please sign in to comment.