Announcement

Collapse
No announcement yet.

Automated alert for squawk 7700

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Automated alert for squawk 7700

    Hello hobbists!
    The script down below sends me an SMS every time a target in my coverage area squawks 7700.
    I'm feeding FR24 with a Raspberry Pi3 but any Linux installation should comply with this.
    SSH to your box and...

    1) nano /etc/fr24feed.ini

    Code:
    [...]
    bs="yes"
    [...]
    2) sudo su
    3) apt-get install inotify-tools
    4) nano /root/squawk.sh

    Code:
    #!/bin/bash
    sleep 15
    curl -v --silent localhost:30003 | awk -F, -v OFS=, '{if ($18 =="7700") print $5,$18}' >/tmp/7700.txt &
    while true; do
    inotifywait -e modify /tmp/7700.txt
    [COLOR="#EE82EE"]sms=$(tail -n1 /tmp/7700.txt)
    curl -X POST "[OBFUSCATED]"
    sleep 120[/COLOR]
    done
    5) chmod +x /root/squawk.sh
    6) nano /etc/rc.local

    Code:
    [...]
    if [ "$_IP" ]; then
      printf "My IP address is %s\n" "$_IP"
    fi
    /root/./squawk.sh    <----- ADD THIS
    exit 0
    7) reboot

    That's it. The idea is that when you receive an ADS-B message with a "squawk 7700" indication, the script executes the highlighted portion of the code.
    I had to obfuscate the "curl" string that enables me to send SMS since it's a paid service (approx. 1€ for 10 sms).
    If you prefer use the "mail" command!
    Last edited by Cauchee; 2018-10-10, 20:06.
    T-NOOB-001
Working...
X