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 @@ -292,6 +292,23 @@ sub mysql_setup {
292
292
badprint " Attempted to use login credentials from Plesk, but they failed.\n " ;
293
293
exit 0;
294
294
}
295
+ } elsif ( -r " /usr/local/directadmin/conf/mysql.conf" and $doremote == 0 ){
296
+ # It's a DirectAdmin box, use the available credentials
297
+ my $mysqluser =` cat /usr/local/directadmin/conf/mysql.conf | egrep '^user=.*'` ;
298
+ my $mysqlpass =` cat /usr/local/directadmin/conf/mysql.conf | egrep '^passwd=.*'` ;
299
+
300
+ $mysqluser =~ s / user=// ;
301
+ $mysqluser =~ s / [\r\n ]// ;
302
+ $mysqlpass =~ s / passwd=// ;
303
+ $mysqlpass =~ s / [\r\n ]// ;
304
+
305
+ $mysqllogin = " -u $mysqluser -p$mysqlpass " ;
306
+
307
+ my $loginstatus = ` mysqladmin ping $mysqllogin 2>&1` ;
308
+ unless ($loginstatus =~ / mysqld is alive/ ) {
309
+ badprint " Attempted to use login credentials from DirectAdmin, but they failed.\n " ;
310
+ exit 0;
311
+ }
295
312
} elsif ( -r " /etc/mysql/debian.cnf" and $doremote == 0 ){
296
313
# We have a debian maintenance account, use it
297
314
$mysqllogin = " --defaults-file=/etc/mysql/debian.cnf" ;
You can’t perform that action at this time.
0 commit comments