#!/usr/bin/php -q
<?php

set_time_limit(0);

$file = $argv[1];

if (file_exists ($file)) {
    include("geoip.inc");
    geoip_load_shared_mem ($file);
    if ($shmid = @shmop_open (GEOIP_SHM_KEY, "a", 0, 0)) {
        $sz = shmop_size ($shmid);
        print "$sz bytes loaded into shared memory segment "
                    . GEOIP_SHM_KEY . "\n";
        @shmop_close ($shmid);
    }
}
else {
    print "Error: '$file' not found.\n";
    print "\n\nUsage: loadgeoip.php <filename>\n\n";
    exit;
}

?>
