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];}
}

View 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;

View 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);
}

View File

@@ -2,3 +2,4 @@
. /opt/pakfire/lib/functions.sh
extract_files
chmod nobody.nobody /var/ipfire/mpfire