Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 
 

46 rindas
996 B

  1. #!/bin/bash
  2. ### Run as a normal user
  3. if [ $EUID -eq 0 ]; then
  4. echo "This script shouldn't be run as root."
  5. exit 1
  6. fi
  7. ## import common lib
  8. . "$HOME/.noaa.conf"
  9. . "$NOAA_HOME/common.sh"
  10. if [ -z "$1" ]; then
  11. log "Usage: $0 <frequency>. Example: $0 90.3" "ERROR"
  12. exit 1
  13. fi
  14. command_exists() {
  15. if ! command -v "$1" &> /dev/null; then
  16. log "Required command not found: $1" "ERROR"
  17. exit 1
  18. fi
  19. }
  20. command_exists "sox"
  21. command_exists "socat"
  22. IP=$(ip route | grep "link src" | awk {'print $NF'})
  23. if pgrep "rtl_fm" > /dev/null
  24. then
  25. log "There is an existing rtl_fm instance running, I quit" "ERROR"
  26. exit 1
  27. fi
  28. echo "$(tput setaf 2)
  29. The server is in testing mode tuned to $1 Mhz!
  30. Open a terminal in your computer and paste:
  31. ncat $IP 8073 | play -t mp3 -
  32. $(tput sgr0)
  33. "
  34. rtl_fm ${BIAS_TEE} -f "$1M" -s 256k -g 48 -p 55 -E deemp -F 9 - \
  35. | sox -traw -r256k -es -b16 -c1 -V1 - -tmp3 - \
  36. | socat -u - TCP-LISTEN:8073 1>/dev/null