mirror of
https://github.com/unraid/webgui.git
synced 2026-01-05 00:59:48 -06:00
feat: replace_key_job script to create cron & to execute the replace key job
This commit is contained in:
22
emhttp/plugins/dynamix/scripts/replace_key_job
Executable file
22
emhttp/plugins/dynamix/scripts/replace_key_job
Executable 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user