? station-916658-2.patch
Index: ripper.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/station/archive/scripts/ripper.inc,v
retrieving revision 1.6
diff -u -p -r1.6 ripper.inc
--- ripper.inc	29 Aug 2009 08:01:42 -0000	1.6
+++ ripper.inc	28 Sep 2010 01:59:37 -0000
@@ -19,3 +19,12 @@ overlap_seconds = 60
 
 ; The file type of the stream; "mp3" and "ogg" are supported.
 file_format = "mp3"
+
+; Pre-rip command - command(s) to be executed before the ripping starts - separate multiple
+; commands with a semicolon. This is meant for shell commands, and won't parse PHP directly. 
+prerip_command = ""
+
+; Post-rip command - command(s) to be executed at the end of the ripping script - separate
+; multiple commands with a semicolon. This is meant for shell commands, and won't parse PHP directly.
+postrip_command = ""
+
Index: ripper.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/station/archive/scripts/ripper.php,v
retrieving revision 1.12
diff -u -p -r1.12 ripper.php
--- ripper.php	22 Sep 2010 03:21:38 -0000	1.12
+++ ripper.php	28 Sep 2010 01:59:37 -0000
@@ -46,6 +46,12 @@ $start_time = round_to_nearest_hour(time
 $end_time = $start_time + 3600;
 $length = ($end_time - time()) + (int) $settings['overlap_seconds'];
 
+// Execute any pre-rip commands specified in the inc file
+$prerip_command = ($settings['prerip_command']);
+if (!empty($settings['prerip_command'])) {
+	exec("{$prerip_command}");
+}
+
 // Download the stream
 $stream_url = $settings['stream_url'];
 $file_format = strtolower($settings['file_format']);
@@ -58,6 +64,12 @@ if (file_exists($cuefile)) {
   unlink($cuefile);
 }
 
+// Execute any post-rip commands specified in the inc file
+$postrip_command = ($settings['postrip_command']);
+if (!empty($settings['postrip_command'])) {
+	exec("{$postrip_command}");
+}
+
 exit(0);
 
 
