From 05fb11a5f7bf5b98785594062b8d86461ea12a7c Mon Sep 17 00:00:00 2001 From: meklis Date: Tue, 11 Jun 2024 10:18:24 +0300 Subject: [PATCH] Fixed --- src/Modules/CData/FD16xxV3/OntRebootTelnetGpon.php | 8 +------- src/Modules/CData/FD16xxV3/OntResetTelnetGpon.php | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/Modules/CData/FD16xxV3/OntRebootTelnetGpon.php b/src/Modules/CData/FD16xxV3/OntRebootTelnetGpon.php index baa4292c..77bb0a55 100644 --- a/src/Modules/CData/FD16xxV3/OntRebootTelnetGpon.php +++ b/src/Modules/CData/FD16xxV3/OntRebootTelnetGpon.php @@ -30,14 +30,8 @@ public function run($filter = []) if(!$interface['id']) { throw new \Exception("Incorrect ONU number"); } - if (!preg_match('/^(pon|xge|ge)([0-9])\/([0-9])\/([0-9]){1,}\:?([0-9]{1,3})?\/?([0-9]{1,3})?$/', $interface['name'], $m)) { - throw new \Exception("Interface {$filter['interface']} not supported!"); - } - if(count($m) < 5) { - throw new \Exception("Allow to reboot only ONTs"); - } $this->_exe("interface gpon 0/0"); - $this->_exe("ont reboot {$m[4]} {$m[5]}"); + $this->_exe("ont reboot {$interface['_port']} {$interface['_onu']}"); $this->response = true; return $this; } diff --git a/src/Modules/CData/FD16xxV3/OntResetTelnetGpon.php b/src/Modules/CData/FD16xxV3/OntResetTelnetGpon.php index 505604e9..a5f6e295 100644 --- a/src/Modules/CData/FD16xxV3/OntResetTelnetGpon.php +++ b/src/Modules/CData/FD16xxV3/OntResetTelnetGpon.php @@ -30,14 +30,8 @@ public function run($filter = []) if(!$interface['id']) { throw new \Exception("Incorrect ONU number"); } - if (!preg_match('/^(pon|xge|ge)([0-9])\/([0-9])\/([0-9]){1,}\:?([0-9]{1,3})?\/?([0-9]{1,3})?$/', $interface['name'], $m)) { - throw new \Exception("Interface {$filter['interface']} not supported!"); - } - if(count($m) < 5) { - throw new \Exception("Allow to reboot only ONTs"); - } $this->_exe("interface gpon 0/0"); - $this->_exe("ont restore factory {$m[4]} {$m[5]}"); + $this->_exe("ont restore factory {$interface['_port']} {$interface['_onu']}"); $this->response = true; return $this; }