Add Socket Support to zmupdate (#1867)
* Update zmupdate.pl.in * Fix spacing * Update zmupdate.pl.in
This commit is contained in:
parent
200f92b1ad
commit
3e35fc24a3
|
@ -410,10 +410,23 @@ if ( $version )
|
||||||
|
|
||||||
if ( $response =~ /^[yY]$/ )
|
if ( $response =~ /^[yY]$/ )
|
||||||
{
|
{
|
||||||
my ( $host, $port ) = ( $Config{ZM_DB_HOST} =~ /^([^:]+)(?::(.+))?$/ );
|
my ( $host, $portOrSocket ) = ( $Config{ZM_DB_HOST} =~ /^([^:]+)(?::(.+))?$/ );
|
||||||
my $command = "mysqldump";
|
my $command = "mysqldump";
|
||||||
$command .= " -h".$host if defined($host);
|
if ( defined($portOrSocket) )
|
||||||
$command .= " -P".$port if defined($port);
|
{
|
||||||
|
if ( $portOrSocket =~ /^\// )
|
||||||
|
{
|
||||||
|
$command .= " -S".$portOrSocket;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$command .= " -h".$host." -P".$portOrSocket;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$command .= " -h".$host;
|
||||||
|
}
|
||||||
if ( $dbUser )
|
if ( $dbUser )
|
||||||
{
|
{
|
||||||
$command .= ' -u'.$dbUser;
|
$command .= ' -u'.$dbUser;
|
||||||
|
@ -449,9 +462,23 @@ if ( $version )
|
||||||
my $dbh = shift;
|
my $dbh = shift;
|
||||||
my $version = shift;
|
my $version = shift;
|
||||||
|
|
||||||
my ( $host, $port ) = ( $Config{ZM_DB_HOST} =~ /^([^:]+)(?::(.+))?$/ );
|
my ( $host, $portOrSocket ) = ( $Config{ZM_DB_HOST} =~ /^([^:]+)(?::(.+))?$/ );
|
||||||
my $command = "mysql -h".$host;
|
my $command = "mysql";
|
||||||
$command .= " -P".$port if defined($port);
|
if ( defined($portOrSocket) )
|
||||||
|
{
|
||||||
|
if ( $portOrSocket =~ /^\// )
|
||||||
|
{
|
||||||
|
$command .= " -S".$portOrSocket;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$command .= " -h".$host." -P".$portOrSocket;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$command .= " -h".$host;
|
||||||
|
}
|
||||||
if ( $dbUser )
|
if ( $dbUser )
|
||||||
{
|
{
|
||||||
$command .= " -u".$dbUser;
|
$command .= " -u".$dbUser;
|
||||||
|
|
Loading…
Reference in New Issue