1
0
mirror of https://github.com/Yubico/yubikey-val.git synced 2024-11-29 09:24:12 +01:00

Added sync daemon

This commit is contained in:
Olov Danielson 2009-12-08 12:53:25 +00:00
parent 03366efa60
commit 8a22c88648

36
ykval-daemon Executable file
View File

@ -0,0 +1,36 @@
#!/usr/bin/php -q
<?php
require_once 'ykval-synclib.php';
require_once 'ykval-config.php';
require_once "System/Daemon.php";
$appname="ykval-daemon";
System_Daemon::setOption("appName", $appname);
System_Daemon::setOption("appDescription", "Yubico val-server sync daemon");
System_Daemon::setOption("authorName", "olov@yubico.com");
System_Daemon::setOption("authorEmail", "olov@yubico.com");
System_Daemon::start(); // Spawn Deamon!
$autostart_path = System_Daemon::writeAutoRun();
if ($path){
error_log("Successfully created autostart script at " . $autostart_path);
}
error_log($appname . " started");
$sl = new SyncLib();
# Loop forever and resync
while (True) {
$sl->reSync($baseParams['__YKVAL_SYNC_OLD_LIMIT__']);
sleep($baseParams['__YKVAL_SYNC_INTERVAL__']);
}
System_Daemon::stop();
?>