feat: implement RadiusService for guest management and AccountEnforcementService for session monitoring
Build and Push Docker Image to Gitea Container Registry / build-and-push (push) Successful in 1m10s
Build and Push Docker Image to Gitea Container Registry / build-and-push (push) Successful in 1m10s
This commit is contained in:
@@ -132,12 +132,22 @@ public class AccountEnforcementService : BackgroundService
|
||||
}
|
||||
};
|
||||
process.Start();
|
||||
string output = await process.StandardOutput.ReadToEndAsync(ct);
|
||||
string error = await process.StandardError.ReadToEndAsync(ct);
|
||||
await process.WaitForExitAsync(ct);
|
||||
_logger.LogInformation("Sent RADIUS Disconnect-Request to NAS {NasIp} for user {Username} (MAC: {Mac})", session.NasIpAddress, profile.Username, session.CallingStationId);
|
||||
|
||||
if (process.ExitCode == 0)
|
||||
{
|
||||
_logger.LogInformation("Sent RADIUS Disconnect-Request to NAS {NasIp} for user {Username} (MAC: {Mac}). Response: {Output}", session.NasIpAddress, profile.Username, session.CallingStationId, output);
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.LogWarning("Failed RADIUS Disconnect-Request to NAS {NasIp}. Exit Code: {Code}, Error: {Error}, Output: {Output}", session.NasIpAddress, process.ExitCode, error, output);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Failed to send RADIUS Disconnect-Request to NAS {NasIp}", session.NasIpAddress);
|
||||
_logger.LogError(ex, "Exception sending RADIUS Disconnect-Request to NAS {NasIp}", session.NasIpAddress);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user