fine-tuning configservices cli script
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -9,6 +9,7 @@ use Symfony\Component\Console\Output\OutputInterface;
|
|||||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||||
use Froxlor\FileDir;
|
use Froxlor\FileDir;
|
||||||
use Froxlor\Froxlor;
|
use Froxlor\Froxlor;
|
||||||
|
use Froxlor\PhpHelper;
|
||||||
use Froxlor\Settings;
|
use Froxlor\Settings;
|
||||||
use Froxlor\SImExporter;
|
use Froxlor\SImExporter;
|
||||||
use Froxlor\Database\Database;
|
use Froxlor\Database\Database;
|
||||||
@@ -51,6 +52,11 @@ final class ConfigServices extends Command
|
|||||||
return self::INVALID;
|
return self::INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($input->getOption('import-settings') == false && $input->getOption('create') == false && $input->getOption('apply') == false) {
|
||||||
|
$output->writeln('<error>No option given to do something, exiting.</>');
|
||||||
|
return self::INVALID;
|
||||||
|
}
|
||||||
|
|
||||||
include_once Froxlor::getInstallDir() . 'lng/english.lng.php';
|
include_once Froxlor::getInstallDir() . 'lng/english.lng.php';
|
||||||
include_once Froxlor::getInstallDir() . 'lng/lng_references.php';
|
include_once Froxlor::getInstallDir() . 'lng/lng_references.php';
|
||||||
|
|
||||||
@@ -104,7 +110,7 @@ final class ConfigServices extends Command
|
|||||||
// read in all the distros
|
// read in all the distros
|
||||||
foreach ($distros as $_distribution) {
|
foreach ($distros as $_distribution) {
|
||||||
// get configparser object
|
// get configparser object
|
||||||
$dist = new \Froxlor\Config\ConfigParser($_distribution);
|
$dist = new ConfigParser($_distribution);
|
||||||
// get distro-info
|
// get distro-info
|
||||||
$dist_display = $this->getCompleteDistroName($dist);
|
$dist_display = $this->getCompleteDistroName($dist);
|
||||||
// store in tmp array
|
// store in tmp array
|
||||||
@@ -348,14 +354,14 @@ final class ConfigServices extends Command
|
|||||||
$nameserver = trim($nameserver);
|
$nameserver = trim($nameserver);
|
||||||
// DNS servers might be multi homed; allow transfer from all ip
|
// DNS servers might be multi homed; allow transfer from all ip
|
||||||
// addresses of the DNS server
|
// addresses of the DNS server
|
||||||
$nameserver_ips = \Froxlor\PhpHelper::gethostbynamel6($nameserver);
|
$nameserver_ips = PhpHelper::gethostbynamel6($nameserver);
|
||||||
// append dot to hostname
|
// append dot to hostname
|
||||||
if (substr($nameserver, -1, 1) != '.') {
|
if (substr($nameserver, -1, 1) != '.') {
|
||||||
$nameserver .= '.';
|
$nameserver .= '.';
|
||||||
}
|
}
|
||||||
// ignore invalid responses
|
// ignore invalid responses
|
||||||
if (!is_array($nameserver_ips)) {
|
if (!is_array($nameserver_ips)) {
|
||||||
// act like \Froxlor\PhpHelper::gethostbynamel6() and return unmodified hostname on error
|
// act like PhpHelper::gethostbynamel6() and return unmodified hostname on error
|
||||||
$nameserver_ips = array(
|
$nameserver_ips = array(
|
||||||
$nameserver
|
$nameserver
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user