X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=scripts%2Ffetchdumps.pl;h=1bb0736fb3093e04bbd51069f203666a43df77ed;hb=64bdde3313377c96ab60ebbd311b46277d2764b2;hp=44a8d411eb7f00270ccb5c86545a78e70b61a67e;hpb=f7e7744546daea3bb524a6822e4028dcac2b4cde;p=ndwebbie.git diff --git a/scripts/fetchdumps.pl b/scripts/fetchdumps.pl index 44a8d41..1bb0736 100755 --- a/scripts/fetchdumps.pl +++ b/scripts/fetchdumps.pl @@ -27,7 +27,9 @@ use DBD::Pg qw(:pg_types); use LWP::Simple; -use lib qw{/var/www/ndawn/}; +use FindBin; +use lib "$FindBin::Bin/../lib"; + use ND::DB; our $dbh = ND::DB::DB(); @@ -50,12 +52,14 @@ for my $type ("planet","alliance","galaxy"){ $select->finish; } -if ($updated > 36){ - `/var/www/ndawn/scripts/parsealliances.pl $updated`; - `/var/www/ndawn/scripts/parseplanets.pl $updated`; - `/var/www/ndawn/scripts/parsegalaxies.pl $updated`; - `/var/www/ndawn/scripts/ndrank.pl`; +if ($updated){ + `perl $FindBin::Bin/parsealliances.pl $updated`; + `perl $FindBin::Bin/parseplanets.pl $updated`; + `perl $FindBin::Bin/parsegalaxies.pl $updated`; + `perl $FindBin::Bin/ndrank.pl`; $dbh->do(q{UPDATE misc SET value = ? WHERE id = 'TICK'}, undef, $updated); + system 'killall','-USR1', 'irssi'; + local $dbh->{Warn} = 0; $dbh->do(q{VACUUM ANALYZE}); }