fix: ipv6 scp should use -6 flag

This commit is contained in:
Andras Bacsai 2024-10-02 08:15:03 +02:00
parent 73e38ff951
commit 4d86b556a4
2 changed files with 8 additions and 1 deletions

View file

@ -94,7 +94,9 @@ public static function generateScpCommand(Server $server, string $source, string
$muxPersistTime = config('constants.ssh.mux_persist_time');
$scp_command = "timeout $timeout scp ";
if ($server->isIpv6()) {
$scp_command .= '-6 ';
}
if (self::isMultiplexingEnabled()) {
$scp_command .= "-o ControlMaster=auto -o ControlPath=$muxSocket -o ControlPersist={$muxPersistTime} ";
self::ensureMultiplexedConnection($server);

View file

@ -1221,4 +1221,9 @@ public function storageCheck(): ?string
return instant_remote_process($commands, $this, false);
}
public function isIpv6(): bool
{
return str($this->ip)->contains(':');
}
}