Merge pull request #1612 from RaspAP/fix/wg-status

Update method to determine wg-quick state
This commit is contained in:
Bill Zimmerman 2024-07-07 20:31:16 +02:00 committed by GitHub
commit ed008730e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -64,9 +64,9 @@ function DisplayWireGuardConfig()
}
// fetch service status
exec('pidof wg-crypt-wg0 | wc -l', $wgstatus);
$serviceStatus = $wgstatus[0] == 0 ? "down" : "up";
$wg_state = ($wgstatus[0] > 0);
exec('systemctl is-active wg-quick@wg0', $wgstatus);
$serviceStatus = $wgstatus[0] == 'inactive' ? "down" : "up";
$wg_state = ($wgstatus[0] == 'active' ? true : false );
$public_ip = get_public_ip();
echo renderTemplate(