install -v -m 755 $(DIR_SRC)/config/mpfire/mpfire.pl /var/ipfire/mpfire/bin
install -v -m 644 $(DIR_SRC)/config/mpfire/mpd.conf /var/ipfire/mpfire/
install -v -m 644 $(DIR_SRC)/config/mpfire/webradio /var/ipfire/mpfire/
- chown root.nobody /var/ipfire/mpfire/{settings,playlist.m3u,webradio,mpd.conf}
- chown root.nobody /var/ipfire/mpfire/db/mpd.db
+ chown root.nobody /var/ipfire/mpfire/{mpd.conf,playlist.m3u}
+ chown nobody.nobody /var/ipfire/mpfire/{settings,webradio}
+ chown root.nobody /var/ipfire/mpfire/db/mpd.db
@$(POSTBUILD)
else
snprintf(buffer, STRING_SIZE - 1, "/bin/sed -e 's/^#\\?\\(\\*\\.\\*[[:blank:]]\\+@.\\+\\)$/#\\1/' /etc/syslog.conf >&%d", config_fd );
- snprintf(buffer, STRING_SIZE - 1, "/bin/sed 's#.*/var/log/messages.*#%s /var/log/messages#' /etc/syslog.conf >&%d", varmessages, config_fd );
+ snprintf(buffer, STRING_SIZE - 1, "/bin/sed -e 's#\\.\\*/var/log/messages\\.\\*#%s /var/log/messages#' /etc/syslog.conf >&%d", varmessages, config_fd );
/* if the return code isn't 0 failsafe */
if ((rc = unpriv_system(buffer,99,99)) != 0)
. /opt/pakfire/lib/functions.sh
extract_files
-ln -svf ../init.d/mpd /etc/rc.d/rc3.d/S65mpd
-ln -svf ../init.d/mpd /etc/rc.d/rc0.d/K35mpd
-ln -svf ../init.d/mpd /etc/rc.d/rc6.d/K35mpd
+ln -svf /etc/init.d/mpd /etc/rc.d/rc3.d/S65mpd
+ln -svf /etc/init.d/mpd /etc/rc.d/rc0.d/K35mpd
+ln -svf /etc/init.d/mpd /etc/rc.d/rc6.d/K35mpd
+ln -svf /etc/init.d/mpd /etc/rc.d/rc6.d/K35mpd
+ln -svf /var/ipfire/mpfire/mpd.conf /etc/mpd.conf
touch /var/log/mpd.error.log
touch /var/log/mpd.log
foreach (@devices){
chomp $_;
$diskstats = `iostat -d -t $_ | tail -2 | head -1 | awk '{ print \$5","\$6}'`;
-$status = `hdparm -C /dev/$_ | tail -1 | cut -d: -f2`;
+
+if ( $_ =~ /^s/ ){$status = `sdparm --command=ready /dev/$_ | tail -1`;}
+else {$status = `hdparm -C /dev/$_ | tail -1 | cut -d: -f2`;}
+
chomp $status;
chomp $diskstats;
-if ($debug){print "Device ".$_." is in status".$status." and has ".$diskstats." write and read Requests.\n";}
+if ($debug){print "Device ".$_." is in status ".$status." and has ".$diskstats." write and read Requests.\n";}
sleep 30;
+
$newdiskstats = `iostat -d -t $_ | tail -2 | head -1 | awk '{ print \$5","\$6}'`;
chomp $newdiskstats;
- if ($diskstats eq $newdiskstats && $status !=~/standby/){
+ if ($diskstats eq $newdiskstats && $status !~/standby/){
if ($debug){print "Device ".$_." is set to standy.\n";}
- system("/sbin/hdparm -y /dev/$_");
+ if ( $_ =~ /^s/ ){system("sdparm --command=stop /dev/$_");}
+ else {system("/sbin/hdparm -y /dev/$_");}
system("touch /tmp/hddshutdown-$_");
}
- else{
+ elsif ($diskstatus{$_} ne "0" ){
if ($debug){print "Device ".$_." is active.\n";}
if ( -e "/tmp/hddshutdown-$_" ) { system("unlink /tmp/hddshutdown-$_"); }
}
+ elsif ( $status =~/standby/ ){
+ if ($debug){print "Device ".$_." is in standby mode.\n";}
+ }
}
# end
if ( -e "$path_smartctl" )
{
- system("$path_smartctl -iHA /dev/$disk > /var/log/smartctl_out_hddtemp-$disk");
+ system("$path_smartctl -iHA -d ata /dev/$disk > /var/log/smartctl_out_hddtemp-$disk");
}
if ( -e "$path_hddtemp" )