lnms dev:simulate check simulated device exists (#14243)

This commit is contained in:
Tony Murray
2022-08-25 02:58:40 -05:00
committed by GitHub
parent 70e0a17031
commit a0b8b09f97

View File

@@ -51,6 +51,13 @@ class DevSimulate extends LnmsCommand
$snmprec_dir = $this->snmpsim->getDir();
$listen = $this->snmpsim->getIp() . ':' . $this->snmpsim->getPort();
$file = $this->argument('file');
if ($file && ! file_exists(base_path("tests/snmpsim/$file.snmprec"))) {
$this->error("$file does not exist");
return 1;
}
$snmpsim = new Process([
$this->snmpsim->findSnmpsimd(),
"--data-dir=$snmprec_dir",