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 8ec321c commit 785888c
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions dump1090_restart/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/tree/main
#License: CC BY-NC-ND 4.0

if pgrep “dump1090” > /dev/null
then

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

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

else

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

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

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

fi

0 comments on commit 785888c

Please sign in to comment.