OSDN Git Service

fix to usbremove bug
author“nanbuwks” <“nanbuwks-sourceforge@nanbu.com”>
Tue, 30 Mar 2010 05:17:13 +0000 (14:17 +0900)
committer“nanbuwks” <“nanbuwks-sourceforge@nanbu.com”>
Tue, 30 Mar 2010 05:17:13 +0000 (14:17 +0900)
package/usr/bin/usbremove2

index a52e9d0..0d8e468 100755 (executable)
@@ -1,6 +1,9 @@
 #! /usr/bin/perl
 use DBI;
 use File::Path;
+use YAML;
+$conf = YAML::LoadFile("/etc/squarantine/squarantine.conf");
+
 open(FILE,">>/tmp/usbunplug") or die;
     print FILE "--------------", "\n";
 foreach my $key( keys %ENV ){
@@ -11,7 +14,7 @@ foreach my $key( keys %ENV ){
 system("umount ".$ENV{'DEVNAME'});
 
 ##MOUNTPOINT DELETE##
-my $dbh = DBI->connect("DBI:mysql:squarantine", "root", "Cab6402!") || die "CONNECT ERROR $DBI::ERRSTR";
+$dbh = DBI->connect("DBI:mysql:$conf->{MYSQL_DB}", "$conf->{MYSQL_USER}", "$conf->{MYSQL_PASS}") || die "CONNECT ERROR $DBI::ERRSTR";
 
 my $sth = $dbh->prepare("select nickname,memo,flags from media where id_serial=\'".$ENV{'ID_SERIAL'}."\'");
 $sth->execute;