diff --git a/discord/report_new_matches.ps1 b/discord/report_new_matches.ps1 index d0cf5d3..3f9294a 100644 --- a/discord/report_new_matches.ps1 +++ b/discord/report_new_matches.ps1 @@ -1,6 +1,4 @@ -. .\..\includes\ps1\lockfile.ps1 - -new-lock +Start-Transcript -Path '/var/log/dtch/report_new_matches.log' -Append if ($PSScriptRoot.length -eq 0) { $scriptroot = Get-Location @@ -8,6 +6,8 @@ if ($PSScriptRoot.length -eq 0) { else { $scriptroot = $PSScriptRoot } +. $scriptroot\..\includes\ps1\lockfile.ps1 +new-lock $fileContent = Get-Content -Path "$scriptroot/../config/config.php" -Raw @@ -169,4 +169,5 @@ $newJson = $player_matches | ConvertTo-Json -Depth 100 # Display the updated JSON $newJson | out-file "$scriptroot/../data/player_matches.json" -remove-lock \ No newline at end of file +remove-lock +Stop-Transcript \ No newline at end of file diff --git a/discord/report_to_discord.ps1 b/discord/report_to_discord.ps1 index 2811502..5369ffd 100644 --- a/discord/report_to_discord.ps1 +++ b/discord/report_to_discord.ps1 @@ -1,7 +1,4 @@ - -. .\..\includes\ps1\lockfile.ps1 - -new-lock +Start-Transcript -Path '/var/log/report_new_matches.log' -Append if ($PSScriptRoot.length -eq 0) { $scriptroot = Get-Location @@ -9,6 +6,8 @@ if ($PSScriptRoot.length -eq 0) { else { $scriptroot = $PSScriptRoot } +. $scriptroot\..\includes\ps1\lockfile.ps1 +new-lock function IsValidEntry($entry) { return ($entry.KD_H -ne 'NaN' -and $entry.KD_ALL -ne 'NaN') -and ($entry.KD_H -ne 'Infinity' -and $entry.KD_ALL -ne 'Infinity') @@ -99,4 +98,5 @@ $payload = [PSCustomObject]@{ } Invoke-RestMethod -Uri $webhookurl -Method Post -Body ($payload | ConvertTo-Json) -ContentType 'Application/Json' -remove-lock \ No newline at end of file +remove-lock +Stop-Transcript \ No newline at end of file