File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -497,15 +497,22 @@ public function grant_master_database_rights($verbose = false) {
497497
498498 //* insert the ispconfig user in the remote server
499499 $ from_host = $ conf ['hostname ' ];
500- $ from_ip = gethostbyname ($ conf ['hostname ' ]);
501500
502501 $ hosts [$ from_host ]['user ' ] = $ conf ['mysql ' ]['master_ispconfig_user ' ];
503502 $ hosts [$ from_host ]['db ' ] = $ conf ['mysql ' ]['master_database ' ];
504503 $ hosts [$ from_host ]['pwd ' ] = $ conf ['mysql ' ]['master_ispconfig_password ' ];
505504
506- $ hosts [$ from_ip ]['user ' ] = $ conf ['mysql ' ]['master_ispconfig_user ' ];
507- $ hosts [$ from_ip ]['db ' ] = $ conf ['mysql ' ]['master_database ' ];
508- $ hosts [$ from_ip ]['pwd ' ] = $ conf ['mysql ' ]['master_ispconfig_password ' ];
505+ $ ip_list =array ();
506+ $ ip_rec =dns_get_record ($ conf ['hostname ' ], DNS_A + DNS_AAAA );
507+ if (!empty ($ ip_rec )) foreach ($ ip_rec as $ rec => $ ip ) $ ip_list []=@(isset ($ ip ['ip ' ]))?$ ip ['ip ' ]:$ ip ['ipv6 ' ];
508+
509+ if (!empty ($ ip_list )) {
510+ foreach ($ ip_list as $ ip ) {
511+ $ hosts [$ ip ]['user ' ] = $ conf ['mysql ' ]['master_ispconfig_user ' ];
512+ $ hosts [$ ip ]['db ' ] = $ conf ['mysql ' ]['master_database ' ];
513+ $ hosts [$ ip ]['pwd ' ] = $ conf ['mysql ' ]['master_ispconfig_password ' ];
514+ }
515+ }
509516 } else {
510517 /*
511518 * it is NOT a master-slave - Setup so we have to find out all clients and their
You can’t perform that action at this time.
0 commit comments