mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 15:54:03 +02:00
parent
2d69e44846
commit
aea7b068da
@ -22,11 +22,22 @@ class TokenCommand extends Command
|
|||||||
*
|
*
|
||||||
* USAGE:
|
* USAGE:
|
||||||
*
|
*
|
||||||
* icingacli setup token show
|
* icingacli setup token show [options]
|
||||||
|
*
|
||||||
|
* OPTIONS:
|
||||||
|
*
|
||||||
|
* --config=<directory> Path to Icinga Web 2's configuration files [/etc/icingaweb2]
|
||||||
*/
|
*/
|
||||||
public function showAction()
|
public function showAction()
|
||||||
{
|
{
|
||||||
$token = file_get_contents($this->app->getConfigDir() . '/setup.token');
|
$configDir = $this->params->get('config', $this->app->getConfigDir());
|
||||||
|
if (! is_string($configDir) || strlen(trim($configDir)) === 0) {
|
||||||
|
$this->fail($this->translate(
|
||||||
|
'The argument --config expects a path to Icinga Web 2\'s configuration files'
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
$token = file_get_contents($configDir . '/setup.token');
|
||||||
if (! $token) {
|
if (! $token) {
|
||||||
$this->fail(
|
$this->fail(
|
||||||
$this->translate('Nothing to show. Please create a new setup token using the generateToken action.')
|
$this->translate('Nothing to show. Please create a new setup token using the generateToken action.')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user