function buildWhitelist($aspid = false) { $unix = new unix(); if (!$aspid) { $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid"; $pid = $unix->get_pid_from_file($pidfile); if ($unix->process_exists($pid, basename(__FILE__))) { $time = $unix->PROCCESS_TIME_MIN($pid); if ($GLOBALS["OUTPUT"]) { echo "Building......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} service Already Artica task running PID {$pid} since {$time}mn\n"; } return; } @file_put_contents($pidfile, getmypid()); } $amavis = new amavis(); $amavis->whitelist_sender_maps(); if ($GLOBALS["OUTPUT"]) { echo "Building......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} Building Whitelist done\n"; } reload(true); }