diff --git a/app/Commands/MariadbClientInstallCommand.php b/app/Commands/MariadbClientInstallCommand.php index 339e75a..0c59258 100644 --- a/app/Commands/MariadbClientInstallCommand.php +++ b/app/Commands/MariadbClientInstallCommand.php @@ -82,7 +82,7 @@ class MariadbClientInstallCommand extends Command system('rsync -rv --include="ca-cert.pem" --include="client-cert.pem" --include="client-key.pem" --exclude="*" '.$this->argument('remove_user').'@'.$this->argument('remove_host').':/etc/mysql/ssl/ /etc/mysql/ssl/'); // checking if certificates are exists from remote server - if (!file_exist('/etc/mysql/ssl/ca-cert.pem') || !file_exist('/etc/mysql/ssl/client-cert.pem') || file_exist('/etc/mysql/ssl/client-key.pem')) { + if (!file_exists('/etc/mysql/ssl/ca-cert.pem') || !file_exists('/etc/mysql/ssl/client-cert.pem') || !file_exists('/etc/mysql/ssl/client-key.pem')) { $this->error('Failed! Certificates not found!'); exit(); } diff --git a/app/Commands/MariadbInstallCommand.php b/app/Commands/MariadbInstallCommand.php index 7a5475c..8992c46 100644 --- a/app/Commands/MariadbInstallCommand.php +++ b/app/Commands/MariadbInstallCommand.php @@ -150,7 +150,7 @@ class MariadbInstallCommand extends Command system('openssl rsa -in /etc/mysql/ssl/client-key.pem -out /etc/mysql/ssl/client-key.pem'); system('openssl x509 -req -in /etc/mysql/ssl/client-req.pem -days 365000 -CA /etc/mysql/ssl/ca-cert.pem -CAkey /etc/mysql/ssl/ca-key.pem -set_serial 01 -out /etc/mysql/ssl/client-cert.pem'); - if (!file_exist('/etc/mysql/ssl/ca-cert.pem') || !file_exist('/etc/mysql/ssl/client-cert.pem') || file_exist('/etc/mysql/ssl/client-key.pem')) { + if (!file_exists('/etc/mysql/ssl/ca-cert.pem') || !file_exists('/etc/mysql/ssl/client-cert.pem') || !file_exists('/etc/mysql/ssl/client-key.pem')) { $this->error('Failed! Certificates not created!'); exit(); } @@ -175,7 +175,7 @@ ssl-key=/etc/mysql/ssl/client-key.pem'); system('chmod 644 /etc/mysql/ssl/*cert*'); system('chmod 644 /etc/mysql/ssl/*key*'); - system('service restart mysql'); + system('systemctl restart mariadb'); system('ufw allow mysql'); $this->info('Mariadb remote...Success! \o/');