Merge pull request #6 from koebi001/master
use the maintenance account on a debian system
This commit is contained in:
commit
71f14ea053
1 changed files with 12 additions and 1 deletions
|
@ -292,8 +292,19 @@ sub mysql_setup {
|
||||||
badprint "Attempted to use login credentials from Plesk, but they failed.\n";
|
badprint "Attempted to use login credentials from Plesk, but they failed.\n";
|
||||||
exit 0;
|
exit 0;
|
||||||
}
|
}
|
||||||
|
} elsif ( -r "/etc/mysql/debian.cnf" and $doremote == 0 ){
|
||||||
|
# We have a debian maintenance account, use it
|
||||||
|
$mysqllogin = "--defaults-file=/etc/mysql/debian.cnf";
|
||||||
|
my $loginstatus = `mysqladmin $mysqllogin ping 2>&1`;
|
||||||
|
if ($loginstatus =~ /mysqld is alive/) {
|
||||||
|
goodprint "Logged in using credentials from debian maintenance account.\n";
|
||||||
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
# It's not Plesk, we should try a login
|
badprint "Attempted to use login credentials from debian maintenance account, but they failed.\n";
|
||||||
|
exit 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
# It's not Plesk or debian, we should try a login
|
||||||
my $loginstatus = `mysqladmin $remotestring ping 2>&1`;
|
my $loginstatus = `mysqladmin $remotestring ping 2>&1`;
|
||||||
if ($loginstatus =~ /mysqld is alive/) {
|
if ($loginstatus =~ /mysqld is alive/) {
|
||||||
# Login went just fine
|
# Login went just fine
|
||||||
|
|
Loading…
Reference in a new issue