[
    {
        "UpdateStageName": "Delete Active File",
        "UpdateSourcePlatform": "Linux",
        "UpdateSource": "Executable",
        "UpdateSourceData": "/bin/bash",
        "UpdateSourceArgs": "-c \"rm -f \\\"{{$FullBaseDir}}battleye/\\\"beserver_x64_active_*.cfg >/dev/null 2>&1\"",
        "SkipOnFailure": true
    },
    {
        "UpdateStageName": "Delete Active File",
        "UpdateSourcePlatform": "Windows",
        "UpdateSource": "Executable",
        "UpdateSourceData": "cmd.exe",
        "UpdateSourceArgs": "/C del /Q /F \"{{$FullBaseDir}}battleye\\\"beserver_x64_active_*.cfg > NUL 2>&1",
        "SkipOnFailure": true
    },
    {
        "UpdateStageName": "Manage Bikeys",
        "UpdateSourcePlatform": "Linux",
        "UpdateSource": "Executable",
        "UpdateSourceData": "/bin/bash",
        "UpdateSourceArgs": "-c \"cd dayz/223350; find keys -name \\\"*.bikey\\\" ! -name \\\"dayz.bikey\\\" -delete; IFS=\\\";\\\" read -ra subdirs_array <<< \\\"{{mod}};{{clientmod}}\\\"; for subdir in \\\"${subdirs_array[@]}\\\"; do [ -n \\\"$(shopt -s nullglob; echo $subdir/*.bikey)\\\" ] && \\cp \\\"$subdir/\\\"*.bikey keys/ >/dev/null 2>&1; [ -d \\\"$subdir/keys\\\" ] && \\cp \\\"$subdir/keys/\\\"*.bikey keys/ >/dev/null 2>&1; [ -d \\\"$subdir/key\\\" ] && \\cp \\\"$subdir/key/\\\"*.bikey keys/ >/dev/null 2>&1; done\"",
        "UpdateSourceConditionSetting": "ManageBikeys",
        "UpdateSourceConditionValue": "true",
        "SkipOnFailure": true
    },
    {
        "UpdateStageName": "Manage Bikeys",
        "UpdateSourcePlatform": "Windows",
        "UpdateSource": "Executable",
        "UpdateSourceData": "powershell.exe",
        "UpdateSourceArgs": "-NoProfile -Command \"$subdirs = \\\"{{mod}};{{clientmod}}\\\" -split ';'; Set-Location dayz\\223350; Remove-Item '.\\keys\\*.bikey' -Exclude 'dayz.bikey' -Force -ErrorAction SilentlyContinue; foreach ($subdir in $subdirs) { Get-ChildItem -Path \\\"$subdir\\*.bikey\\\" -File -ErrorAction SilentlyContinue | ForEach-Object { Copy-Item $_ -Destination '.\\keys' }; if (Test-Path \\\"$subdir\\keys\\\") { Copy-Item \\\"$subdir\\keys\\*.bikey\\\" -Destination '.\\keys' -Force -ErrorAction SilentlyContinue }; if (Test-Path \\\"$subdir\\key\\\") { Copy-Item \\\"$subdir\\key\\*.bikey\\\" -Destination '.\\keys' -Force -ErrorAction SilentlyContinue }; }\"",
        "UpdateSourceConditionSetting": "ManageBikeys",
        "UpdateSourceConditionValue": "true",
        "SkipOnFailure": true
    }
]