Added copying config file.
Checks for server's config file is exist and copy it to profile location if not.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# wDayzManager v0.4
|
||||
# wDayzManager v0.5
|
||||
# Copyright (c) 2024 Vladislav Salikov aka W0LF aka 'dreamforce'
|
||||
# https://github.com/dreamforceinc
|
||||
# Required module: PSIni
|
||||
@@ -302,7 +302,17 @@ foreach ($srv in $servers) {
|
||||
$serverProfile = "$($serverLocation)\$($profilesLocation)\$($instance)"
|
||||
}
|
||||
$serverProfile = [System.IO.Path]::GetFullPath($serverProfile)
|
||||
Write-Host "serverProfile: $($serverProfile)"
|
||||
|
||||
# Checks for server's config file is exist and copy it to profile location if not
|
||||
if (-not (Test-Path -Path "$($serverProfile)\")) {
|
||||
New-Item -ItemType Directory -Path "$($serverProfile)\" | Out-Null
|
||||
Copy-Item -Path "$($serverLocation)\serverDZ.cfg" -Destination "$($serverProfile)\$($serverConfig)"
|
||||
}
|
||||
else {
|
||||
if (-not (Test-Path -Path "$($serverProfile)\$($serverConfig)")) {
|
||||
Copy-Item -Path "$($serverLocation)\serverDZ.cfg" -Destination "$($serverProfile)\$($serverConfig)"
|
||||
}
|
||||
}
|
||||
|
||||
$startupMods = @("`"-mod=$($startupClientMods)`"", "`"-serverMod=$($startupServerMods)`"")
|
||||
$startupParams = @("`"-profiles=$($serverProfile)`"", "`"-config=$($serverProfile)\$($serverConfig)`"", "-port=$($serverPort)", "-cpuCount=$($serverCPU)")
|
||||
|
||||
Reference in New Issue
Block a user