From 02cf41a11a34360d82cd92270c0fc1834188c26b Mon Sep 17 00:00:00 2001 From: Patrick Veilleux Date: Thu, 25 Jan 2024 09:43:33 -0500 Subject: [PATCH] Add Enshrouded Support Fix Extentionless files backup Disable Debug Mode --- functions/server/Backup-Server.psm1 | 2 +- global.psm1 | 4 ++-- templates/enshrouded.psm1 | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/functions/server/Backup-Server.psm1 b/functions/server/Backup-Server.psm1 index 1f22d02..014017e 100644 --- a/functions/server/Backup-Server.psm1 +++ b/functions/server/Backup-Server.psm1 @@ -32,7 +32,7 @@ try { } # Define the filter to exclude certain files from the backup $ExcludeFilter = { - $_.Name -notmatch $Backups.Exclusions -and $_.Extension -notin $Global.Exclusions + ($_.Name -notmatch $Backups.Exclusions -and $_.Extension -notin $Global.Exclusions) -or $null -eq $_.Extension -or $_.Extension -eq '' } # Get all files that should be included in the backup diff --git a/global.psm1 b/global.psm1 index 08fe032..e643c16 100644 --- a/global.psm1 +++ b/global.psm1 @@ -15,7 +15,7 @@ $GlobalDetails = @{ LogFolder = ".\logs" #File extensions to exclude from backups - Exclusions = @(".tmp", ".bak", ".log", ".old", ".temp") + Exclusions = @(".tmp", ".bak", ".log", ".old", ".temp", ".backup") #Number of days to keep server logs Days = 30 @@ -61,7 +61,7 @@ $GlobalDetails = @{ # Debug Mode (will not delete any logs or script files and will ignore script locks) # !!! DO NOT ENABLE IN PRODUCTION !!! - Debug = $true + Debug = $false } #Create the object diff --git a/templates/enshrouded.psm1 b/templates/enshrouded.psm1 index c3428db..14ba14d 100644 --- a/templates/enshrouded.psm1 +++ b/templates/enshrouded.psm1 @@ -197,7 +197,7 @@ Add-Member -InputObject $Server -Name "WorkingDirectory" -Type NoteProperty -Val function Start-ServerPrep { # Check if the config file is almost empty and if so, write the default config to it. - Write-ScriptMsg "Writing configuration to $($Server.ConfigFolder)\enshrouded_server.ini" + Write-ScriptMsg "Writing configuration to $($Server.ConfigFolder)\enshrouded_server.json" $jsonObject = @{ "name"= $Server.ServerName "password" = $Server.Password @@ -210,7 +210,7 @@ function Start-ServerPrep { } $content = $jsonObject | ConvertTo-Json - Set-Content -Path "$($Server.ConfigFolder)/enshrouded_server.ini" -Value $content + Set-Content -Path "$($Server.ConfigFolder)/enshrouded_server.json" -Value $content Write-ScriptMsg "Port Forward : $($Server.Port) and $($Server.QueryPort) in TCP and UDP to $($Global.InternalIP)" }