Skip to content

Commit

Permalink
Update script.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaaker authored Dec 31, 2023
1 parent 743f971 commit d47fc66
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions dump1090_status/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,20 @@
# 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

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
sudo 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
sudo echo "[$(date +"%d-%m-%Y %H:%M:%S")] Dump1090 stopped running" > /var/log/dump1090_restart_log.txt

#Restarting Services
systemctl restart dump1090-fa.service
Expand Down

0 comments on commit d47fc66

Please sign in to comment.