]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - config/mpfire/mpfire.pl
MPFire nochmal konrrigiert
[people/pmueller/ipfire-2.x.git] / config / mpfire / mpfire.pl
index fae4cd09e28871d30c1107088d5140e1fd6c954b..e386ecdd3fe90c80a3cd44b44f5aa2ec8c9f7c03 100644 (file)
@@ -7,10 +7,6 @@ require "${General::swroot}/header.pl";
 my $filename = "";
 my $debug = 0; 
 
-if ( ! -e /var/run/mpd.pid){
-  system("mpd >/dev/null");
-}
-
 if ($ARGV[0] eq 'scan') {
   if ($debug){print "Creating Database\n";}
   system("mpd --create-db >/dev/null");
@@ -75,9 +71,10 @@ elsif ($ARGV[0] eq 'stats') {
   }
 elsif ($ARGV[0] eq 'playweb') {
   &checkmute();
+  &stop(); 
   &clearplaylist();
   if ($debug){print "Playing webstream $ARGV[1] \n";}
-     system("mpc add http://$ARGV[1] >/dev/null && mpc play >/dev/null && sleep 1");
+     system("mpc add \"http://$ARGV[1]\" >/dev/null && mpc play >/dev/null && sleep 1");
   }
 elsif ($ARGV[0] eq 'volume') {
  $temp = "Master - ";
@@ -91,6 +88,10 @@ sub clearplaylist(){
   system("mpc clear >/dev/null");  
   }
 
+sub stop(){
+  system("mpc stop >/dev/null");  
+  }
+
 sub checkplaylist(){
  my $Datei = "/var/ipfire/mpfire/playlist.m3u";
  my @Info = stat($Datei);