Skip to content

Commit

Permalink
Add Enshrouded Support
Browse files Browse the repository at this point in the history
Fix Extentionless files backup
Disable Debug Mode
  • Loading branch information
patrix87 committed Jan 25, 2024
1 parent 39985e7 commit 02cf41a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion functions/server/Backup-Server.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions global.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions templates/enshrouded.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)"
}
Expand Down

0 comments on commit 02cf41a

Please sign in to comment.