Advertisement
Guest User

Untitled

a guest
May 5th, 2012
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. Record radio / audio stream (asx/asf) with a webserver
  2. #!/bin/bash
  3. #Go to the archive directory:
  4. cd /aa/icecast/archive
  5. #Stop the archiving for the last hour:
  6. kill `cat archivePID`
  7.  
  8. #Start recording in the background (&) a new archive file of the stream "http://127.0.0.1:8000/stream.ogg":
  9. wget http://127.0.0.1:8000/stream.ogg &
  10.  
  11. #Get the Process IS for the job we just started:
  12. echo $! > archivePID
  13.  
  14. #Wait a few seconds to make sure the job has started and the archive file has been opened:
  15. sleep 5
  16.  
  17. #Rename the current archive file to a name based on the date and time (YYYYMMDD-HHMM.ogg):
  18. mv stream.ogg `date +%Y%m%d-%H%M.ogg`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement