mirror of
https://github.com/cryptomator/cryptomator.git
synced 2024-11-23 12:09:45 +00:00
parameterize patchWebDAV.ps1 and add default values to .bat file (#2251)
Co-authored-by: Armin Schrenk <armin.schrenk@skymatic.de>
This commit is contained in:
parent
78bb996072
commit
90f523bee8
6
dist/win/contrib/patchWebDAV.bat
vendored
6
dist/win/contrib/patchWebDAV.bat
vendored
@ -1,3 +1,7 @@
|
||||
@echo off
|
||||
:: Default values for Cryptomator builds
|
||||
SET LOOPBACK_ALIAS="cryptomator-vault"
|
||||
|
||||
cd %~dp0
|
||||
powershell -NoLogo -NonInteractive -ExecutionPolicy Unrestricted -Command .\patchWebDAV.ps1
|
||||
powershell -NoLogo -NonInteractive -ExecutionPolicy Unrestricted -Command .\patchWebDAV.ps1^
|
||||
-LoopbackAlias %LOOPBACK_ALIAS%
|
12
dist/win/contrib/patchWebDAV.ps1
vendored
12
dist/win/contrib/patchWebDAV.ps1
vendored
@ -1,10 +1,16 @@
|
||||
#Requires -RunAsAdministrator
|
||||
Param(
|
||||
[Parameter(Mandatory, HelpMessage="Please provide an alias for 127.0.0.1")][string] $LoopbackAlias
|
||||
)
|
||||
|
||||
# Adds for address 127.0.0.1 the 'cryptomator-vault' alias to the hosts file
|
||||
# Adds an alias for 127.0.0.1 to the hosts file
|
||||
function Add-AliasToHost {
|
||||
param (
|
||||
[string]$LoopbackAlias
|
||||
)
|
||||
$sysdir = [Environment]::SystemDirectory
|
||||
$hostsFile = "$sysdir\drivers\etc\hosts"
|
||||
$aliasLine = '127.0.0.1 cryptomator-vault'
|
||||
$aliasLine = "127.0.0.1 $LoopbackAlias"
|
||||
|
||||
foreach ($line in Get-Content $hostsFile) {
|
||||
if ($line -eq $aliasLine){
|
||||
@ -49,7 +55,7 @@ function Edit-ProviderOrder {
|
||||
}
|
||||
|
||||
|
||||
Add-AliasToHost
|
||||
Add-AliasToHost $LoopbackAlias
|
||||
Write-Output 'Ensured alias exists in hosts file'
|
||||
|
||||
Set-WebDAVFileSizeLimit
|
||||
|
Loading…
Reference in New Issue
Block a user