]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/commitdiff
Fixes am MPFire und an der backupctrl
authormaniacikarus <maniacikarus@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Sat, 21 Jul 2007 17:23:57 +0000 (17:23 +0000)
committermaniacikarus <maniacikarus@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Sat, 21 Jul 2007 17:23:57 +0000 (17:23 +0000)
git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@715 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8

config/mpfire/mpfire.pl
html/cgi-bin/mpfire.cgi
src/misc-progs/backupctrl.c
src/paks/mpfire/install.sh

index 921733ce8c1e2141f5f8405a85bc024a5dfb7466..876fed4370a347d8a018713cb2d105cb492cd645 100644 (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];}
   }
index 4907b5092b67845f96a7ec8eddc46c64ba6600e4..a3d81c108aba4c3fa1f2eb01e37b40ee90aacd3e 100644 (file)
@@ -153,7 +153,12 @@ print <<END
 
     <table width='95%' cellspacing='0'>
     <tr bgcolor='$color{'color20'}'>    <td colspan='5' align='center'><marquee behavior='alternate' scrollamount='1' scrolldelay='5'><font color=red>-= $song =-</font></marquee></td></tr>
-    <tr><td colspan='5' align='center'><br/><b>total $#songdb songs</b><br/><br/></td></tr>
+END
+;
+if ( $#songdb > -1 ){
+print"<tr><td colspan='5' align='center'><br/><b>total $#songdb songs</b><br/><br/></td></tr>";
+}
+print <<END
     <tr>
     <td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'><input type='hidden' name='ACTION' value='x' /><input type='image' alt='$Lang::tr{'stop'}' title='$Lang::tr{'stop'}' src='/images/media-playback-stop.png' /></form></td>
     <td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'><input type='hidden' name='ACTION' value='||' /><input type='image' alt='$Lang::tr{'pause'}' title='$Lang::tr{'pause'}' src='/images/media-playback-pause.png' /></form></td>
@@ -176,7 +181,7 @@ END
 ;
 &Header::closebox();
 
-if ( $#songdb ne '0' ){
+if ( $#songdb > -1 ){
 &Header::openbox('100%', 'center', $Lang::tr{'quick playlist'});
 
 my @artist;
index b4ce67cb7499e5feaaffb5b89cba095ce6da90fa..62229d6e20cf228dbd42b42a38dd1add4397ead9 100644 (file)
@@ -37,11 +37,9 @@ int main(int argc, char *argv[]) {
                    exit (1);
                }
                else{
-                   fprintf (stderr, "Wrong or no Argument!\n");
-                   exit (1);
+               sprintf(add, " %s", argv[i]);
+                   strcat(command, add);
     }
-               sprintf(add, " %s", argv[i]);
-               strcat(command, add);
        }
        return safe_system(command);
 }
index a47a7831dc62dba77d122eb1f06347e98cb65ff9..3fd647c3619360f3fd0d929ceeca90688c92b6ed 100644 (file)
@@ -2,3 +2,4 @@
 . /opt/pakfire/lib/functions.sh
 
 extract_files
+chmod nobody.nobody /var/ipfire/mpfire