Commit fded2799 authored by Marius Burkard's avatar Marius Burkard

- fixed handling interactive mode in AI

parent cac71457
Pipeline #2588 passed with stage
in 41 seconds
......@@ -291,11 +291,6 @@ Possible arguments are:
try {
$os = ISPConfigBaseOS::getOSVersion();
if(!self::wantsAmavis() && (!isset($_GET['channel']) || $_GET['channel'] !== 'dev')) {
ISPConfigLog::info('<lightred>NOTE:</lightred> Installing ISPConfig stable with rspamd is not supported until 3.1.15 release (due to rspamd support). Please use --channel=dev to install stable-3.1 git development branch or --use-amavis to use amavis instead of rspamd.', true);
exit;
}
ISPConfigLog::info('Starting perfect server setup for ' . $os['NAME'], true);
$installer = ISPConfigBaseOS::getOSInstance();
$installer->runPerfectSetup();
......
......@@ -86,7 +86,7 @@ class ISPConfigBaseOS {
while($result === false && $tries > 0) {
$return_var = 0;
$output = array();
$tmp = exec($cmd, $output, $return_var);
exec($cmd, $output, $return_var);
ISPConfigLog::debug('CMD: ' . $cmd . ' returned code ' . $return_var);
if($return_var === 0 || (!empty($returncodes_ok) && is_array($returncodes_ok) && in_array($return_var, $returncodes_ok, true))) {
$result = implode("\n", $output);
......@@ -99,6 +99,23 @@ class ISPConfigBaseOS {
return $result;
}
public function passthru($cmd, $returncodes_ok = array(), $tries = 1, $retry_codes = null) {
$result = false;
while($result === false && $tries > 0) {
$return_var = 0;
passthru($cmd, $return_var);
ISPConfigLog::debug('CMD: ' . $cmd . ' returned code ' . $return_var);
if($return_var === 0 || (!empty($returncodes_ok) && is_array($returncodes_ok) && in_array($return_var, $returncodes_ok, true))) {
$result = true;
} elseif(is_array($retry_codes) && !empty($retry_codes) && !in_array($return_var, $retry_codes)) {
break;
}
$tries--;
}
return $result;
}
protected function addLines($file, $entries, $add_if_existing = false) {
if(!is_array($entries)) {
$entries = array($entries);
......
......@@ -1123,7 +1123,11 @@ mailman-unsubscribe: "|/var/lib/mailman/mail/mailman unsubscribe mailman"';
$cmd .= ' ; wget -O ispconfig.tar.gz "https://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz" >/dev/null 2>&1 ; tar xzf ispconfig.tar.gz';
}
$cmd .= ' ; cd ispconfig3_install ; cd install ; php -q install.php ' . $ai_argument . ' 2>&1 ; cd /tmp ; rm -rf ispconfig3_install 2>&1';
$result = $this->exec($cmd);
if(ISPConfig::wantsInteractive()) {
$result = $this->passthru($cmd);
} else {
$result = $this->exec($cmd);
}
if($result === false) {
throw new ISPConfigOSException('Command ' . $cmd . ' failed.');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment