27 lines
592 B
PHP
Executable File
27 lines
592 B
PHP
Executable File
#!/usr/bin/php
|
|
<?php
|
|
require_once dirname(__DIR__) . "/loader.php";
|
|
require_once dirname(__DIR__) . "/plugins/netsync/Netsync.php";
|
|
|
|
try {
|
|
|
|
|
|
|
|
$rpc = new StaticRPC();
|
|
$instance = $rpc->getPlugins()["netsync"] ?? null;
|
|
if ($instance === null) {
|
|
throw new RuntimeException("Plugin is not enabled");
|
|
}
|
|
/**
|
|
* @var Netsync $instance
|
|
*/
|
|
|
|
$config = $instance->getRoutingConfig();
|
|
$outfile = $argv[1];
|
|
file_put_contents($outfile, implode("\n", $config));
|
|
} catch (Exception $e) {
|
|
echo "\nError:" . $e->getMessage() . "\n";
|
|
exit(1);
|
|
}
|
|
|
|
exit(0); |