X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=scripts%2Ffetchdumps.pl;h=883c90f37c2a3edb4822c27d9ea913a91c9b6591;hb=e71f5648d2823f89024c52b77f9ab04d23a75a2d;hp=a01b58e3ca3e71893cd08ce8bd3b1268136faf16;hpb=35f9a1e8b0edc2cc47dd46b9afc77e48cc3be86c;p=ndwebbie.git diff --git a/scripts/fetchdumps.pl b/scripts/fetchdumps.pl index a01b58e..883c90f 100755 --- a/scripts/fetchdumps.pl +++ b/scripts/fetchdumps.pl @@ -22,12 +22,16 @@ q{ use strict; use warnings; +use local::lib; use DBI; use DBD::Pg qw(:pg_types); -use LWP::Simple; +use LWP::Simple qw/head get $ua/; +$ua->agent("Stupid user agent check is stupid"); + +use FindBin; +use lib "$FindBin::Bin/../lib"; -use lib qw{/var/www/ndawn/}; use ND::DB; our $dbh = ND::DB::DB(); @@ -51,12 +55,13 @@ for my $type ("planet","alliance","galaxy"){ } if ($updated){ - `/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`; + `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); - $dbh->do(q{VACUUM ANALYZE}); + system 'killall','-USR1', 'ndbot.pl'; + local $dbh->{Warn} = 0; }