Support custom BPQ Telnet prompts and banners, fix installer arguments
This commit is contained in:
1 parent
33d2cc4fbd
commit
2b00b1cbbd
14 files changed
+168
-44
No files matched your search
+3
-3
@@ -1,4 +1,4 @@
|
||||
param([string]$BpqRoot,[int]$Port,[int]$HttpPort,[int]$RadioPort,[string]$SysopUser,[string]$ForwardPeer,[string]$CmsPeer,[string]$VaraLogPath,[string]$NodeExe,[switch]$EnableRadioCAT,[switch]$DisableRadioCAT,[switch]$CheckOnly,[switch]$AutoStart,[switch]$EnableLAN,[switch]$Restart)
|
||||
param([string]$BpqRoot,[int]$Port,[int]$HttpPort,[int]$RadioPort,[string]$SysopUser,[string]$ForwardPeer,[string]$CmsPeer,[string]$VaraLogPath,[string]$NodeExe,[ValidateSet("it","en")][string]$Language,[switch]$EnableRadioCAT,[switch]$DisableRadioCAT,[switch]$CheckOnly,[switch]$AutoStart,[switch]$EnableLAN,[switch]$Restart)
|
||||
$ErrorActionPreference='Stop'
|
||||
if($EnableRadioCAT -and $DisableRadioCAT){throw 'Scegliere una sola opzione CAT.'}
|
||||
if($AutoStart -and !$CheckOnly -and ($env:BPQ_CONSOLE_CONFIG -or $env:BPQ_ROOT -or $env:BPQ_CONSOLE_PORT)){throw 'Per -AutoStart usare console.config.json nella cartella del progetto, senza override BPQ_* temporanei.'}
|
||||
@@ -30,8 +30,8 @@ if($targetPort -ge 1024 -and $targetPort -le 65535){
|
||||
if($listener){$owner=Get-CimInstance Win32_Process -Filter "ProcessId=$($listener[0].OwningProcess)";if($owner.Name -ne 'node.exe' -or !$owner.CommandLine -or $owner.CommandLine.IndexOf((Join-Path $PSScriptRoot 'server.mjs'),[StringComparison]::OrdinalIgnoreCase) -lt 0){throw "Porta $targetPort occupata da un altro processo. Specificare -Port con una porta libera."}}
|
||||
}
|
||||
$nodeArgs=@((Join-Path $PSScriptRoot 'install.mjs'),'--bpq-root',$BpqRoot,'--config-path',$configPath)
|
||||
$mapping=@{Port='port';HttpPort='http-port';RadioPort='radio-port';SysopUser='sysop-user';ForwardPeer='forward-peer';CmsPeer='cms-peer';VaraLogPath='vara-log'}
|
||||
foreach($name in $mapping.Keys){if($PSBoundParameters.ContainsKey($name)){$nodeArgs+=@('--'+$mapping[$name],[string](Get-Variable -Name $name -ValueOnly))}}
|
||||
$mapping=@{Port='port';HttpPort='http-port';RadioPort='radio-port';SysopUser='sysop-user';ForwardPeer='forward-peer';CmsPeer='cms-peer';VaraLogPath='vara-log';Language='language'}
|
||||
foreach($name in $mapping.Keys){if($PSBoundParameters.ContainsKey($name)){$nodeArgs+=@(('--'+$mapping[$name]),[string](Get-Variable -Name $name -ValueOnly))}}
|
||||
if(!$VaraLogPath){$vara=Get-Process -Name VARA -ErrorAction SilentlyContinue | Select-Object -First 1;if($vara.Path){$varaLog=Join-Path (Split-Path $vara.Path) 'VARAHF.log';if(Test-Path -LiteralPath $varaLog){$nodeArgs+=@('--vara-log',$varaLog)}}}
|
||||
if($EnableRadioCAT){$nodeArgs+='--enable-radio-cat'}
|
||||
if($DisableRadioCAT){$nodeArgs+='--disable-radio-cat'}
|
||||
|
||||
Reference in new issue
Block a user