Fix Ruijie network device detection (#1168)

This commit is contained in:
陈大猫
2026-06-01 13:52:22 +08:00
committed by GitHub
parent 429cb8d6e9
commit ea41389842
8 changed files with 56 additions and 2 deletions

View File

@@ -165,6 +165,11 @@ test("detectVendorFromSshVersion recognizes legacy Huawei VRP dash banner", () =
assert.equal(detectVendorFromSshVersion("SSH-2.0--"), "huawei");
});
test("detectVendorFromSshVersion recognizes Ruijie RGOS banner", () => {
assert.equal(detectVendorFromSshVersion("RGOS_SSH"), "ruijie");
assert.equal(detectVendorFromSshVersion("SSH-2.0-RGOS_SSH"), "ruijie");
});
test("shouldProbeSessionCwd allows the probe on a plain Linux host", () => {
assert.equal(
shouldProbeSessionCwd({ isNetworkDevice: false, remoteSshVersion: "OpenSSH_9.6" }),

View File

@@ -34,6 +34,7 @@ export const NETWORK_DEVICE_OPTIONS = [
'fortinet',
'paloalto',
'zyxel',
'ruijie',
] as const;
export type NetworkDeviceVendor = typeof NETWORK_DEVICE_OPTIONS[number];
@@ -118,6 +119,9 @@ export const detectVendorFromSshVersion = (softwareVersion?: string): '' | Netwo
// ZyXEL ZyWALL
if (/^Zyxel\s*SSH/i.test(s)) return 'zyxel';
// Ruijie RGOS
if (/^RGOS_SSH\b/i.test(s)) return 'ruijie';
return '';
};