add retic.exe download to install script

This commit is contained in:
Kevin Woley
2020-02-08 14:45:01 -08:00
parent a6bc1d4ab8
commit 12a7142511
3 changed files with 14 additions and 2 deletions

3
.gitignore vendored
View File

@@ -1,4 +1,5 @@
local.exclude
logs
restic.exe
secrets.ps1
secrets.ps1
state.xml

View File

@@ -1,6 +1,7 @@
# backup configuration
$ExeName = "restic.exe"
$InstallPath = "C:\restic"
$ResticExe = Join-Path $InstallPath "restic.exe"
$ResticExe = Join-Path $InstallPath $ExeName
$StateFile = Join-Path $InstallPath "state.xml"
$WindowsExcludeFile = Join-Path $InstallPath "windows.exclude"
$LocalExcludeFile = Join-Path $InstallPath "local.exclude"

View File

@@ -1,5 +1,15 @@
. .\config.ps1
# download restic
if(-not (Test-Path $ResticExe)) {
$url = "https://github.com/restic/restic/releases/download/v0.9.6/restic_0.9.6_windows_amd64.zip"
$output = Join-Path $InstallPath "restic.zip"
Invoke-WebRequest -Uri $url -OutFile $output
Expand-Archive -LiteralPath $output $InstallPath
Remove-Item $output
Get-ChildItem *.exe | Rename-Item -NewName $ExeName
}
# Create log directory if it doesn't exit
if(-not (Test-Path $LogPath)) {