mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-30 01:04:09 +02:00
cli/setup: Issue nice error messages when creating the config directory fails
This commit is contained in:
parent
865b5c126a
commit
9f545535a0
@ -55,22 +55,31 @@ class ConfigCommand extends Command
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! mkdir($configDir)) {
|
if (! file_exists($configDir) && ! @mkdir($configDir)) {
|
||||||
$this->fail(sprintf($this->translate('Can\'t create configuration directory %s'), $configDir));
|
$e = error_get_last();
|
||||||
}
|
|
||||||
|
|
||||||
if (! chmod($configDir, octdec($mode))) {
|
|
||||||
$this->fail(sprintf(
|
$this->fail(sprintf(
|
||||||
$this->translate('Can\'t change the mode of the configuration directory to %s'),
|
$this->translate('Can\'t create configuration directory %s: %s'),
|
||||||
$mode
|
$configDir,
|
||||||
|
$e['message']
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! chgrp($configDir, $group)) {
|
if (! @chmod($configDir, octdec($mode))) {
|
||||||
|
$e = error_get_last();
|
||||||
$this->fail(sprintf(
|
$this->fail(sprintf(
|
||||||
$this->translate('Can\'t change the to change the group of %s to %s'),
|
$this->translate('Can\'t change the mode of the configuration directory to %s: %s'),
|
||||||
|
$mode,
|
||||||
|
$e['message']
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! @chgrp($configDir, $group)) {
|
||||||
|
$e = error_get_last();
|
||||||
|
$this->fail(sprintf(
|
||||||
|
$this->translate('Can\'t change the group of %s to %s: %s'),
|
||||||
$configDir,
|
$configDir,
|
||||||
$group
|
$group,
|
||||||
|
$e['message']
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user