add retic.exe download to install script
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,4 +1,5 @@
|
||||
local.exclude
|
||||
logs
|
||||
restic.exe
|
||||
secrets.ps1
|
||||
secrets.ps1
|
||||
state.xml
|
||||
@@ -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"
|
||||
|
||||
10
install.ps1
10
install.ps1
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user