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:
@@ -102,7 +102,7 @@ namalskMission=
|
|||||||
|
|
||||||
; [Server-6]
|
; [Server-6]
|
||||||
; serverPort=35600
|
; serverPort=35600
|
||||||
; serverConfig=serverDZ.cfg
|
; serverConfig=serverDZ-6.cfg
|
||||||
; serverExeName=DayZServer_x64.exe
|
; serverExeName=DayZServer_x64.exe
|
||||||
; serverCPU=2
|
; serverCPU=2
|
||||||
; startupClientMods=@CF;@VPPAdminTools
|
; startupClientMods=@CF;@VPPAdminTools
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# wDayzManager v0.4
|
# wDayzManager v0.5
|
||||||
# Copyright (c) 2024 Vladislav Salikov aka W0LF aka 'dreamforce'
|
# Copyright (c) 2024 Vladislav Salikov aka W0LF aka 'dreamforce'
|
||||||
# https://github.com/dreamforceinc
|
# https://github.com/dreamforceinc
|
||||||
# Required module: PSIni
|
# Required module: PSIni
|
||||||
@@ -302,7 +302,17 @@ foreach ($srv in $servers) {
|
|||||||
$serverProfile = "$($serverLocation)\$($profilesLocation)\$($instance)"
|
$serverProfile = "$($serverLocation)\$($profilesLocation)\$($instance)"
|
||||||
}
|
}
|
||||||
$serverProfile = [System.IO.Path]::GetFullPath($serverProfile)
|
$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)`"")
|
$startupMods = @("`"-mod=$($startupClientMods)`"", "`"-serverMod=$($startupServerMods)`"")
|
||||||
$startupParams = @("`"-profiles=$($serverProfile)`"", "`"-config=$($serverProfile)\$($serverConfig)`"", "-port=$($serverPort)", "-cpuCount=$($serverCPU)")
|
$startupParams = @("`"-profiles=$($serverProfile)`"", "`"-config=$($serverProfile)\$($serverConfig)`"", "-port=$($serverPort)", "-cpuCount=$($serverCPU)")
|
||||||
|
|||||||
Reference in New Issue
Block a user