Advertisement
int0x21

Untitled

Aug 2nd, 2015
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.69 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. rm /tmp/315.grep 2>/dev/null
  4.  
  5. touch /tmp/315.grep
  6.  
  7.  
  8. function watchrtl {
  9.  
  10.     rtl_fm -f 315000000 -F -C -l 55 | xxd | grep -v ": 0000 0000 0000 0000 0000 0000 0000 0000" > /tmp/315.grep
  11.  
  12. }
  13. function cleanup {
  14.     kill $WATCH_PID
  15.     killall rtl_fm
  16.     exit 0
  17.  
  18. }
  19.  
  20.  
  21. watchrtl &
  22. export WATCH_PID=$!
  23.  
  24. trap 'cleanup' SIGINT
  25.  
  26. sleep 10
  27.  
  28. ORIG_SIZE=`ls -la /tmp/315.grep | cut -f5 -d' '|tr -d "\r\n "`
  29. CUR_SIZE=`ls -la /tmp/315.grep | cut -f5 -d' '|tr -d "\r\n "`
  30.  
  31.  
  32.  
  33. echo Waiting...
  34.  
  35.  
  36. while [[ "$CUR_SIZE" == "$ORIG_SIZE" ]]
  37. do
  38.     sleep 1
  39.     CUR_SIZE=`ls -la /tmp/315.grep | cut -f5 -d' '|tr -d "\r\n "`
  40. done
  41.  
  42. echo
  43. echo "HELLO PROFESSOR FALCON"
  44. echo
  45.  
  46. cleanup
  47.  
  48.  
  49. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement