Skip to content

Commit 6d6eb12

Browse files
authored
Merge pull request #13 from byran77/qixiao/args-name
Rename AD to AE for auto-expiration.
2 parents d3d175d + 5b5feb6 commit 6d6eb12

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

SHIR/setup.ps1

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ function RegisterNewNode {
3131
$NODE_NAME,
3232
$ENABLE_HA,
3333
$HA_PORT,
34-
$ENABLE_AD,
35-
$AD_TIME
34+
$ENABLE_AE,
35+
$AE_TIME
3636
)
3737

3838
Write-Log "Start registering a new SHIR node"
@@ -54,14 +54,14 @@ function RegisterNewNode {
5454
Start-Sleep -Seconds 15
5555
}
5656

57-
if ($ENABLE_AD -eq "true") {
58-
Write-Log "Enable Expired Nodes Auto-Deletion"
59-
if (!$AD_TIME) {
60-
$AD_TIME = 600
57+
if ($ENABLE_AE -eq "true") {
58+
Write-Log "Enable Offline Nodes Auto-Expiration"
59+
if (!$AE_TIME) {
60+
$AE_TIME = 600
6161
}
6262

63-
Write-Log "Node Expiration Time In Seconds: $($AD_TIME)"
64-
Start-Process $DmgcmdPath -Wait -ArgumentList "-RegisterNewNode", "$($AUTH_KEY)", "$($NODE_NAME)", "$($AD_TIME)" -RedirectStandardOutput "C:\SHIR\register-out.txt" -RedirectStandardError "C:\SHIR\register-error.txt"
63+
Write-Log "Node Expiration Time In Seconds: $($AE_TIME)"
64+
Start-Process $DmgcmdPath -Wait -ArgumentList "-RegisterNewNode", "$($AUTH_KEY)", "$($NODE_NAME)", "$($AE_TIME)" -RedirectStandardOutput "C:\SHIR\register-out.txt" -RedirectStandardError "C:\SHIR\register-error.txt"
6565
Start-Sleep -Seconds 15
6666
} else {
6767
Start-Process $DmgcmdPath -Wait -ArgumentList "-RegisterNewNode", "$($AUTH_KEY)", "$($NODE_NAME)" -RedirectStandardOutput "C:\SHIR\register-out.txt" -RedirectStandardError "C:\SHIR\register-error.txt"
@@ -102,7 +102,7 @@ if (Check-Is-Registered) {
102102
} elseif (Test-Path Env:AUTH_KEY) {
103103
Start-Process $DmgcmdPath -Wait -ArgumentList "-Start"
104104

105-
RegisterNewNode $Env:AUTH_KEY $Env:NODE_NAME $Env:ENABLE_HA $Env:HA_PORT $Env:ENABLE_AD $Env:AD_TIME
105+
RegisterNewNode $Env:AUTH_KEY $Env:NODE_NAME $Env:ENABLE_HA $Env:HA_PORT $Env:ENABLE_AE $Env:AE_TIME
106106
} else {
107107
Write-Log "Invalid AUTH_KEY Value"
108108
exit 1

0 commit comments

Comments
 (0)