Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
auto-tx
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vamp
auto-tx
Commits
5ea19272
Commit
5ea19272
authored
7 years ago
by
Niko Ehrenfeuchter
Browse files
Options
Downloads
Patches
Plain Diff
Add function to check if new config files are available.
Refers to
#28
,
#18
,
#13
parent
7297c966
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Updater/Update-Service.ps1
+42
-0
42 additions, 0 deletions
Updater/Update-Service.ps1
with
42 additions
and
0 deletions
Updater/Update-Service.ps1
+
42
−
0
View file @
5ea19272
...
...
@@ -263,6 +263,48 @@ function Update-Configuration {
}
function
NewConfig
-Available
{
# Check the configuration update path and the given $DstPath for both
# configuration files (common and host-specific) and compare their
# respective file write-time.
#
# Return $True if the update path contains any newer file, $False otherwise.
Param
(
[
Parameter
(
Mandatory
=
$True
)]
[
ValidateScript
({(
Get-Item
$_
)
.
PSIsContainer
})
]
[
String
]
$DstPath
)
# old and new common configuration
$OComm
=
Join-Path
$DstPath
"config.common.xml"
$NComm
=
Join-Path
$UpdPathConfig
"config.common.xml"
# old and new host-specific configuration
$OHost
=
Join-Path
$DstPath
"
$(
$
env
:
COMPUTERNAME
)
.xml"
$NHost
=
Join-Path
$UpdPathConfig
"
$(
$
env
:
COMPUTERNAME
)
.xml"
$Ret
=
$True
try
{
$Ret
=
(
$
(
File-IsUpToDate
-ExistingFile
$OHost
-UpdateCandidate
$NHost
)
-And
$
(
File-IsUpToDate
-ExistingFile
$OComm
-UpdateCandidate
$NComm
)
)
}
catch
{
Log-Error
$
(
"Checking for new configuration files failed:"
"
$(
$_
.
Exception
.
Message
)
"
)
Return
$False
}
if
(
$Ret
)
{
Write-Verbose
"Configuration is up to date, no new files available."
Return
$False
}
Log-Info
"New configuration files found!"
Return
$True
}
function
Copy
-ServiceFiles
{
try
{
Write-Verbose
"Looking for source package using pattern:
$(
$Pattern
)
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment