1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| #!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
/usr/local/bin/rtl_fm -N -f XXX.XXXXM -s 22.05k -p XX | /usr/local/bin/multimon -a POCSAG512 -a POCSAG1200 -f alpha -t raw /dev/stdin | /bin/sed -u '/^POCSAG[0-9]\{3,4\}[+-]\{1\}: A/!d' | /bin/sed -u '/Address/N;s/POCSAG[0-9]\{3,4\}[+-]\{1\}: Address: \([ 0-9]\{7\}\).*POCSAG[0-9]\{3,4\}[+-]\{1\}: Alpha: \(.*\)/\&adresse=\1\&message=\2/;h;s/\(.*\)/\/bin\/date +"date=%d-%m-%y\&heure=%H:%M:%S"/e;G;s/\n//g' | /usr/bin/tee /home/pi/pocsag/`date +"%Y-%m-%d_%H%M%S"`.csv | { while read ; do /usr/bin/curl -d "$REPLY" http://www.monsite.com/mon_repertoire/mon_fichier.php ; done ;} &
exit 0 |