Skip to content

Commit

Permalink
Merge pull request #24 from Phlogi/patch-1
Browse files Browse the repository at this point in the history
Fix URI parsing
  • Loading branch information
kmwoley authored Feb 22, 2021
2 parents 48b5c61 + 626ac2a commit ed92f4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ function Invoke-ConnectivityCheck {
else {
# parse connection string for hostname
# Uri parser doesn't handle leading connection type info (s3:, sftp:, rest:)
$connection_string = $env:RESTIC_REPOSITORY -replace "^s3:" -replace "^sftp:" -replace "^rest:"
$connection_string = $env:RESTIC_REPOSITORY -replace "^s3:","s3://" -replace "^sftp:","sftp://" -replace "^rest:","rest://"
$repository_host = ([System.Uri]$connection_string).host
}

Expand Down Expand Up @@ -364,4 +364,4 @@ function Invoke-Main {
exit $error_count
}

Invoke-Main
Invoke-Main

0 comments on commit ed92f4e

Please sign in to comment.