Agent parameter logic fix

This commit is contained in:
Oliver Kieselbach
2026-02-05 12:08:47 +01:00
parent db55809b49
commit 8cc6823533
2 changed files with 4 additions and 4 deletions
@@ -95,7 +95,7 @@ namespace AutopilotMonitor.Agent.Core.Configuration
/// <summary>
/// Whether to enable geo-location detection (queries external IP services)
/// </summary>
public bool EnableGeoLocation { get; set; } = false;
public bool EnableGeoLocation { get; set; } = true;
/// <summary>
/// Validates the configuration
+3 -3
View File
@@ -102,7 +102,7 @@ namespace AutopilotMonitor.Agent
var noAuth = args?.Contains("--no-auth") ?? false;
var noCleanup = args?.Contains("--no-cleanup") ?? false;
var rebootOnComplete = args?.Contains("--reboot-on-complete") ?? false;
var enableGeoLocation = args?.Contains("--enable-geolocation") ?? false;
var disableGeoLocation = args?.Contains("--disable-geolocation") ?? false;
// Parse certificate thumbprint if provided
string certThumbprint = null;
@@ -128,7 +128,7 @@ namespace AutopilotMonitor.Agent
bool cleanupOnExit = true;
bool selfDestructOnComplete = true;
bool rebootOnCompleteConfig = false;
bool enableGeoLocationConfig = false;
bool enableGeoLocationConfig = true;
bool useClientCertAuthConfig = true;
// Try to load configuration from JSON file (written by PowerShell bootstrap script)
@@ -206,7 +206,7 @@ namespace AutopilotMonitor.Agent
CleanupOnExit = cleanupOnExit,
SelfDestructOnComplete = selfDestructOnComplete,
RebootOnComplete = rebootOnComplete || rebootOnCompleteConfig,
EnableGeoLocation = enableGeoLocation || enableGeoLocationConfig
EnableGeoLocation = !disableGeoLocation && enableGeoLocationConfig
};
}
}