25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

receive.sh 1.8 KiB

6 년 전
6 년 전
6 년 전
6 년 전
6 년 전
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #!/bin/sh
  2. ## debug
  3. #set -x
  4. . ~/.noaa.conf
  5. ## sane checks
  6. if [ ! -d ${NOAA_HOME} ]; then
  7. mkdir -p ${NOAA_HOME}
  8. fi
  9. if [ ! -d ${NOAA_OUTPUT} ]; then
  10. mkdir -p ${NOAA_OUTPUT}
  11. fi
  12. if [ ! -d ${NOAA_OUTPUT}/audio/ ]; then
  13. mkdir -p ${NOAA_OUTPUT}/audio/
  14. fi
  15. if [ ! -d ${NOAA_OUTPUT}/image/ ]; then
  16. mkdir -p ${NOAA_OUTPUT}/image/
  17. fi
  18. if [ ! -d ${NOAA_HOME}/map/ ]; then
  19. mkdir -p ${NOAA_HOME}/map/
  20. fi
  21. if [ ! -d ${NOAA_HOME}/predict/ ]; then
  22. mkdir -p ${NOAA_HOME}/predict/
  23. fi
  24. if pgrep "rtl_fm" > /dev/null
  25. then
  26. exit 1
  27. fi
  28. # $1 = Satellite Name
  29. # $2 = Frequency
  30. # $3 = FileName base
  31. # $4 = TLE File
  32. # $5 = EPOC start time
  33. # $6 = Time to capture
  34. START_DATE=$(date '+%d-%m-%Y %H:%M')
  35. timeout "${6}" rtl_fm -f "${2}"M -s 60k -g 50 -p 55 -E wav -E deemp -F 9 - | sox -t raw -e signed -c 1 -b 16 -r 60000 - ${NOAA_OUTPUT}/audio/"${3}".wav rate 11025
  36. PASS_START=$(expr "$5" + 90)
  37. /usr/local/bin/wxmap -T "${1}" -H "${4}" -p 0 -l 0 -o "${PASS_START}" ${NOAA_HOME}/map/"${3}"-map.png
  38. for i in ZA MCIR MCIR-precip MSA MSA-precip HVC-precip HVCT-precip HVC HVCT; do
  39. /usr/local/bin/wxtoimg -o -m ${NOAA_HOME}/map/"${3}"-map.png -e $i ${NOAA_OUTPUT}/audio/"${3}".wav ${NOAA_OUTPUT}/image/"${3}"-$i.png
  40. /usr/bin/convert ${NOAA_OUTPUT}/image/"${3}"-$i.png -undercolor black -fill yellow -pointsize 18 -annotate +20+20 "${1} $i ${START_DATE}" ${NOAA_OUTPUT}/image/"${3}"-$i.png
  41. done
  42. ECLIPSED=$(identify -ping -format "%[fx:w]" /usr/share/html/image/$3-MSA.png)
  43. if [ "$ECLIPSED" -gt 1041 ]; then
  44. python2 ${NOAA_HOME}/post.py "$1 ${START_DATE}" ${NOAA_OUTPUT}/image/$3-MCIR-precip.png ${NOAA_OUTPUT}/image/$3-MCIR.png
  45. else
  46. python2 ${NOAA_HOME}/post.py "$1 ${START_DATE}" ${NOAA_OUTPUT}/image/$3-MCIR-precip.png ${NOAA_OUTPUT}/image/$3-MSA-precip.png ${NOAA_OUTPUT}/image/$3-HVC-precip.png ${NOAA_OUTPUT}/image/$3-HVCT.png
  47. fi