mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 13:38:31 +00:00
Refactor UsageChart and UsageStats components to support dynamic period selection
This commit is contained in:
@@ -26,9 +26,10 @@ async function checkCertInstalled(certPath) {
|
||||
function checkCertInstalledMac(certPath) {
|
||||
return new Promise((resolve) => {
|
||||
try {
|
||||
const fingerprint = getCertFingerprint(certPath);
|
||||
exec(`security find-certificate -a -Z /Library/Keychains/System.keychain | grep -i "${fingerprint}"`, (error) => {
|
||||
resolve(!error);
|
||||
// security outputs fingerprint without colons (e.g. "078B6B5F..."), strip them before grep
|
||||
const fingerprint = getCertFingerprint(certPath).replace(/:/g, "");
|
||||
exec(`security find-certificate -a -Z /Library/Keychains/System.keychain | grep -i "${fingerprint}"`, (error, stdout) => {
|
||||
resolve(!error && !!stdout?.trim());
|
||||
});
|
||||
} catch {
|
||||
resolve(false);
|
||||
|
||||
Reference in New Issue
Block a user