Results 1 to 1 of 1

Thread: Automated alert for squawk 7700

  1. #1
    Passenger
    Join Date
    Oct 2018
    Location
    Italy
    Posts
    15

    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
    sms=$(tail -n1 /tmp/7700.txt)
    curl -X POST "[OBFUSCATED]"
    sleep 120
    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 at 20:06.
    T-NOOB-001

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •