From abf421ce089adfb0962085c2201609be89520a65 Mon Sep 17 00:00:00 2001 From: Ermal Date: Sun, 6 Nov 2011 11:58:26 +0000 Subject: Issue proper start and error messages during voucher loading --- etc/inc/voucher.inc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/etc/inc/voucher.inc b/etc/inc/voucher.inc index b06e4d4..dc7f613 100644 --- a/etc/inc/voucher.inc +++ b/etc/inc/voucher.inc @@ -462,8 +462,16 @@ function voucher_configure($sync = false) { if (is_array($config['voucher'])) { foreach ($config['voucher'] as $voucherzone => $vcfg) { + if ($g['booting']) + echo gettext("Enabling voucher support... "); $cpzone = $voucherzone; - voucher_configure_zone($sync); + $error = voucher_configure_zone($sync); + if ($g['booting']) { + if ($error) + echo "error\n"; + else + echo "done\n"; + } } } } @@ -474,8 +482,6 @@ function voucher_configure_zone($sync = false) { if (!isset($config['voucher'][$cpzone]['enable'])) return 0; - if ($g['booting']) - echo "Enabling voucher support... "; if ($sync == true) captiveportal_syslog("Writing voucher db from sync data..."); @@ -531,8 +537,6 @@ function voucher_configure_zone($sync = false) { } unlock($voucherlck); - if ($g['booting']) - echo "done\n"; } return 0; -- cgit v1.1