Index: trunk/install/perl/schedulecheck.pl =================================================================== --- trunk/install/perl/schedulecheck.pl (リビジョン 111) +++ trunk/install/perl/schedulecheck.pl (リビジョン 1) @@ -14,5 +14,4 @@ use DBI; use DBD::Pg; -use DBD::SQLite; use Schedule::At; use Time::Local; @@ -20,5 +19,5 @@ $path = $0; $path =~ s/schedulecheck.pl$//i; -if ($path ne "./"){ +if ($pwd ne "./"){ push( @INC, "$path"); } @@ -30,12 +29,17 @@ #予約番組探し -$now = &epoch2foldate(time()); +$now = &epoch2foldate(`date +%s`); $now = &epoch2foldate($now); $checkrangetime = $now + 15*60;#15分後まで $checkrangetime = &epoch2foldate($checkrangetime); -$dbh = DBI->connect($DSN,$DBUser,$DBPass) ||die $DBI::error;; + my $data_source = sprintf("dbi:%s:dbname=%s;host=%s;port=%d", + $DBDriv,$DBName,$DBHost,$DBPort); + $dbh = DBI->connect($data_source,$DBUser,$DBPass) ||die $DBI::error;; -$sth = $dbh->prepare($stmt{'schedulecheck.1'}); +$DBQuery = "SELECT count(*) FROM foltia_tvrecord "; + + + $sth = $dbh->prepare($DBQuery); $sth->execute(); @titlecount= $sth->fetchrow_array; @@ -44,5 +48,7 @@ exit; }else{ - $sth = $dbh->prepare($stmt{'schedulecheck.2'}); + +$DBQuery = "SELECT tid ,stationid FROM foltia_tvrecord "; + $sth = $dbh->prepare($DBQuery); $sth->execute(); while (($tid,$stationid ) = $sth->fetchrow_array()) { @@ -53,5 +59,4 @@ }#while -#EPG更新 -system("$toolpath/perl/epgimport.pl"); + }