feat: replace_key_job script to create cron & to execute the replace key job

This commit is contained in:
Zack Spear
2024-02-02 16:29:03 -08:00
committed by Zack Spear
parent 4622450b45
commit 9cf3a59c8a

View File

@@ -0,0 +1,22 @@
#!/usr/bin/php -q
<?
$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
require_once "$docroot/plugins/dynamix/include/Wrappers.php";
require_once "$docroot/plugins/dynamix/include/ReplaceKey.php";
switch (@$argv[1] ?? '') {
case 'cron-init':
$text = <<<EOT
# Create replace key job:
15 * * * * /usr/local/emhttp/plugins/dynamix/scripts/replace_key_job &> /dev/null
EOT;
parse_cron_cfg("dynamix", "replace-key-job", $text);
break;
default:
$ReplaceKey = new ReplaceKey();
$ReplaceKey->check();
break;
}