File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -321,6 +321,23 @@ sub mysql_setup {
321
321
badprint " Attempted to use login credentials from Plesk, but they failed.\n " ;
322
322
exit 0;
323
323
}
324
+ } elsif ( -r " /usr/local/directadmin/conf/mysql.conf" and $doremote == 0 ){
325
+ # It's a DirectAdmin box, use the available credentials
326
+ my $mysqluser =` cat /usr/local/directadmin/conf/mysql.conf | egrep '^user=.*'` ;
327
+ my $mysqlpass =` cat /usr/local/directadmin/conf/mysql.conf | egrep '^passwd=.*'` ;
328
+
329
+ $mysqluser =~ s / user=// ;
330
+ $mysqluser =~ s / [\r\n ]// ;
331
+ $mysqlpass =~ s / passwd=// ;
332
+ $mysqlpass =~ s / [\r\n ]// ;
333
+
334
+ $mysqllogin = " -u $mysqluser -p$mysqlpass " ;
335
+
336
+ my $loginstatus = ` mysqladmin ping $mysqllogin 2>&1` ;
337
+ unless ($loginstatus =~ / mysqld is alive/ ) {
338
+ badprint " Attempted to use login credentials from DirectAdmin, but they failed.\n " ;
339
+ exit 0;
340
+ }
324
341
} elsif ( -r " /etc/mysql/debian.cnf" and $doremote == 0 ){
325
342
# We have a debian maintenance account, use it
326
343
$mysqllogin = " --defaults-file=/etc/mysql/debian.cnf" ;
You can’t perform that action at this time.
0 commit comments