Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:rennschnecke1
test
mp3.pl
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File mp3.pl of Package test
#!/usr/bin/perl #alarm(3600); use strict; my $id; my $exists; &lock(); sub free_space { system ("df /home2 > /tmp/df_home2.txt"); open (in,"/tmp/df_home2.txt"); my $line = <in>; $line = <in>; (undef,undef,undef,my $free_space,undef,undef) = split(/\s+/,$line); close in; if ($free_space < 800000) { &unlock(); exec("/bin/mp3_compress.pl"); exit; } } #system("dagrab -iSD /opt/kde2/share/apps/kscd/cddb"); system("dagrab -i > /tmp/dagrab.tmp"); open(in,"/tmp/dagrab.tmp"); while (my $line = <in>) { chomp($line); if ($line =~ /cddb discid/i) { $line =~ /cddb discid:(.*)/i; $id = $1; $id =~ s/ //g; } } close in; #if (not $id) # { # $id = time; # } open (in,"/home2/mp3.list"); while (my $line = <in>) { if ($line =~ /$id/i) { $exists = 1; } } close in; print "-$id-\n"; if (not $exists and $id) { system("/usr/local/bin/cdctl -o1"); &free_space(); system ("rm /home2/mp3.list"); # ohne Jittercorrection #system ("dagrab -v -n100 -e '%track++;mkdir -p \"/home2/tmp/$id\";lame --r3mix \"%s\" \"/home2/tmp/$id/%s.mp3\";rm \"%s\"' all"); # mit Jittercorrection #system ("dagrab -v -J -e '%track++;mkdir -p \"/home2/tmp/$id\";lame --r3mix \"%s\" \"/home2/tmp/$id/%s.mp3\";rm \"%s\"' all"); # nur wav #system ("cd /home2/tmp; dagrab -v -J -e '%track++;mkdir -p \"/home2/tmp/$id\";mv \"%s\" \"/home2/tmp/$id/%s\"' all"); # dagrab #system ("cd /home2/tmp2; dagrab -v -J -e '%track++;mkdir -p \"/home2/tmp2/$id\";mv \"%s\" \"/home2/tmp2/$id/%s\"' all"); #cdparanoia system ("mkdir -p \"/home2/tmp2/$id\"; cd \"/home2/tmp2/$id\"; cdparanoia -B 1-"); system("/usr/local/bin/cdctl -o0"); if ($id) { system ("rm -rf /home2/tmp/$id"); system ("mv /home2/tmp2/$id /home2/tmp/"); open (out,">>/home2/mp3.list"); print out $id."\n"; close out; } system ("eject"); #sleep(60); system("eject -t"); } else { if ($id) { system("eject"); } } &unlock(); sub lock() { open (in,"/tmp/mp3.lock"); my $line = <in>; close in; chomp($line); if ($line ne 'ready' and $line ne '') { my $diff = time - $line; if ($diff > (3600 * 24)) { open (out,">/tmp/mp3.lock"); print out "ready"; close out; } exit; } else { open (out,">/tmp/mp3.lock"); print out time; close out; } } sub unlock() { open (out,">/tmp/mp3.lock"); print out "ready"; close out; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor