Commit 87663c01 authored by Thom's avatar Thom 🛠
Browse files

Move AWS check

parent 873735bd
......@@ -89,16 +89,6 @@ class ISPConfigDebianOS extends ISPConfigBaseOS {
return 'service ' . escapeshellarg($service) . ' ' . $command . ' 2>&1';
}
public function isThisAWS() {
$cmd = "curl --write-out '%{http_code}' --silent --output /dev/null -m 5 http://169.254.169.254/latest/dynamic/instance-identity/";
$result = $this->exec($cmd);
if($result == "200") {
$thisIsAWS = true;
} else {
$thisIsAWS = false;
}
}
protected function updateMySQLConfig($mysql_root_pw) {
ISPConfigLog::info('Writing MySQL config files.', true);
$this->replaceContents('/etc/mysql/debian.cnf', array('/^password\s*=.*$/m' => 'password = ' . $mysql_root_pw));
......@@ -1008,7 +998,13 @@ mailman-unsubscribe: "|/var/lib/mailman/mail/mailman unsubscribe mailman"';
if(ISPConfig::shallInstall('quota')) {
// Check if this is a AWS instance
$this->isThisAWS();
$cmd = "curl --write-out '%{http_code}' --silent --output /dev/null -m 5 http://169.254.169.254/latest/dynamic/instance-identity/";
$result = $this->exec($cmd);
if($result == "200") {
$thisIsAWS = true;
} else {
$thisIsAWS = false;
}
if($thisIsAWS == true) {
// Necessary quota module is removed from the kernel - we will install it.
ISPConfigLog::info('This is a AWS instance.', true);
......
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