Add VPS health endpoint
This commit is contained in:
@@ -21,7 +21,7 @@ public class WireGuardVpsService {
|
||||
|
||||
public Set<String> findUsedVpnIps() {
|
||||
SshCommandResult result = sshService.executeOnConfiguredVps(
|
||||
"sudo wg show wg0 allowed-ips"
|
||||
"sudo /usr/local/sbin/lr-wg-used-ips"
|
||||
);
|
||||
|
||||
if (result.exitCode() != 0) {
|
||||
@@ -65,4 +65,18 @@ public class WireGuardVpsService {
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
public String getVpsHealthJson() {
|
||||
SshCommandResult result = sshService.executeOnConfiguredVps(
|
||||
"sudo /usr/local/sbin/lr-vps-health"
|
||||
);
|
||||
|
||||
if (result.exitCode() != 0) {
|
||||
throw new SshCommandException(
|
||||
"Failed to query VPS health: " + result.stderr()
|
||||
);
|
||||
}
|
||||
|
||||
return result.stdout();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user