Use regex for received file evaluation. Fixes recording received packet names

This commit is contained in:
2023-11-23 23:17:13 +11:00
parent 455fed52ee
commit 0800c48928
5 changed files with 14 additions and 10 deletions

View File

@@ -45,8 +45,8 @@ class PacketInfo extends Command
if ($this->argument('ftn')) {
$a = Address::findFTN($this->argument('ftn'));
} elseif (preg_match('/^(([0-9A-F]+)-)+/',$this->argument('file'),$m)) {
$a = Address::findOrFail(hexdec($m[2]));
} elseif (preg_match(sprintf('/^%s\.pkt$/',Packet::regex),$this->argument('file'),$m)) {
$a = Address::findOrFail(hexdec($m[1]));
}
foreach ($f as $packet) {

View File

@@ -48,8 +48,8 @@ class PacketProcess extends Command
if ($this->argument('ftn')) {
$a = Address::findFTN($this->argument('ftn'));
} elseif (preg_match('/^(([0-9A-F]+)-([0-9]+))+/',$this->argument('file'),$m)) {
$a = Address::findOrFail(hexdec($m[2]));
} elseif (preg_match(sprintf('/^%s\.pkt$/',Packet::regex),$this->argument('file'),$m)) {
$a = Address::findOrFail(hexdec($m[1]));
} else {
$this->error('Unable to determine sender FTN address');