From 43ec78e4062656c6c64fe9514a42e713ddce07c1 Mon Sep 17 00:00:00 2001 From: David Beniamine <david.beniamine@tetras-libre.fr> Date: Mon, 5 Aug 2019 17:42:54 +0200 Subject: [PATCH] Cleaner error handling --- wol/www/index.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/wol/www/index.php b/wol/www/index.php index 4c80652..f8af773 100644 --- a/wol/www/index.php +++ b/wol/www/index.php @@ -33,17 +33,13 @@ error_reporting(E_ALL); extract($_POST); if(!isset($action)){ - $lines=explode(PHP_EOL, shell_exec("../scripts/get_registry.sh")); + exec("../scripts/get_registry.sh", $lines, $code); ?> <p> <?php $n=count($lines); if(empty($lines)){ - echo "Impossible de récupérer le registre"; - ob_start(); - shell_exec("../scripts/get_registry.sh"); - $lines=ob_get_clean(); - echo "$lines"; + echo "Impossible de récupérer le registre, code $code"; }else if ($n == 1){ echo "$n poste est enregistré sur ce serveur"; }else{ -- GitLab