Fixes am MPFire und an der backupctrl

git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@715 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
maniacikarus
2007-07-21 17:23:57 +00:00
parent c03dce35a1
commit 12a2f2ec18
4 changed files with 19 additions and 13 deletions

View File

@@ -41,7 +41,7 @@ elsif ($ARGV[0] eq 'play') {
system("/usr/bin/mpg123 -b 1024 --aggressive -q \"$ARGV[1]\" 2>/dev/null >/dev/null &");
}
elsif ($ARGV[0] eq 'stop') {
my $PID = `ps -ef \| grep wget \| grep EXTM3U \| head -1 \| grep -v "sh -c" \| awk '{ print \$2 }'`;
my $PID = `ps -ef \| grep "wget -qO" \| head -1 \| grep -v "sh -c" \| awk '{ print \$2 }'`;
if ( $PID ne '' ){
if ($debug){print "Stopping $PID\n";}
system("kill -KILL $PID");
@@ -69,12 +69,12 @@ elsif ($ARGV[0] eq 'playall') {
system("/usr/bin/mpg123 -b 1024 --aggressive -Zq@ /var/ipfire/mpfire/playlist 2>/dev/null >/dev/null &");
}
elsif ($ARGV[0] eq 'pause') {
my $PID = `ps -ef \| grep mpg123 \| grep playlist \| head -1 \| grep -v "sh -c" \| awk '{ print \$2 }'`;
my $PID = `ps -ef \| grep mpg123 \| grep playlist \| head -1 \| grep -v "sh -c" \| grep -v "grep" \| awk '{ print \$2 }'`;
if ($debug){print "Pausing Process $PID\n";}
system("kill -STOP $PID");
}
elsif ($ARGV[0] eq 'resume') {
my $PID = `ps -ef \| grep mpg123 \| grep playlist \| head -1 \| grep -v "sh -c" \| awk '{ print \$2 }'`;
my $PID = `ps -ef \| grep mpg123 \| grep playlist \| head -1 \| grep -v "sh -c" \| grep -v "grep" \| awk '{ print \$2 }'`;
if ($debug){print "Resuming Process $PID\n";}
system("kill -CONT $PID");
}
@@ -84,13 +84,15 @@ elsif ($ARGV[0] eq 'next') {
system("kill -SIGINT $PID");
}
elsif ($ARGV[0] eq 'song') {
my $song = `lsof -nX \| grep mpg123 \| grep REG \| grep mem | grep mp3 \| grep -v "sh -c"`;
my $song = `lsof -nX \| grep mpg123 \| grep REG \| grep mem | grep mp3 \| grep -v "sh -c" \| grep -v "grep"`;
my @song = split(/\//,$song);
my $i = @song;
if ( $i == 0 ){
my $song = `ps -ef \| grep wget \| grep EXTM3U \| grep -v "sh -c"`;
my @song = split(/,/,$song);
print $song[1];
my $song = `ps -ef \| grep "wget -qO" \| grep -v "sh -c" \| grep -v "grep"`;
my @song = split(/http\:\/\//,$song);
my $temp = $song[1];
my @song = split(/ /,$temp);
print $song[0];
}
else { print $song[$i-1];}
}