Skip to content

Commit

Permalink
Create script.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaaker authored Dec 31, 2023
1 parent 7841e71 commit e40932b
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions dump1090_status/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
# Created by: Isaaker
# Font Code: https://github.com/Isaaker/isaaker-shell-scripts/new/main/dump1090_status
# License: https://github.com/Isaaker/isaaker-shell-scripts/blob/main/LICENSE.txt

if ! jq '.aircraft | length > 0' /run/dump1090-fa/aircraft.json;
then

#Wall
wall "[$(date +"%d-%m-%Y %H:%M:%S")] Dump1090 still running"

#Log
echo "[$(date +"%d-%m-%Y %H:%M:%S")] Dump1090 still running" > /var/log/dump1090_restart_log.txt

else

#Wall
wall "[$(date +"%d-%m-%Y %H:%M:%S")] Dump1090 stopped running, restarting services"

#Log
echo "[$(date +"%d-%m-%Y %H:%M:%S")] Dump1090 stopped running" > /var/log/dump1090_restart_log.txt

#Restarting Services
systemctl restart dump1090-fa.service
systemctl restart rbfeeder.service
systemctl restart fr24feed.service
systemctl restart piaware.service

fi

0 comments on commit e40932b

Please sign in to comment.