summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2010-12-14 17:09:47 -0500
committerjim-p <jimp@pfsense.org>2010-12-14 17:10:42 -0500
commit0d89a2fcac3deea06bdc4a481bbdfae4f18b1ff8 (patch)
tree579cb2887d12d0e01519096aade9b8f5307b7f1e /etc/inc
parent95ceb35b9124e34ab1d607e2cca489b4fdd6b3a7 (diff)
downloadpfsense-0d89a2fcac3deea06bdc4a481bbdfae4f18b1ff8.zip
pfsense-0d89a2fcac3deea06bdc4a481bbdfae4f18b1ff8.tar.gz
Add voucher backup, configurable from Diagnostics > NanoBSD. Fixes #1087
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/captiveportal.inc15
1 files changed, 14 insertions, 1 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc
index e36a626..bc17f95 100644
--- a/etc/inc/captiveportal.inc
+++ b/etc/inc/captiveportal.inc
@@ -210,8 +210,21 @@ function captiveportal_configure() {
if (isset($config['captiveportal']['enable'])) {
- if ($g['booting'])
+ if ($g['booting']) {
echo "Starting captive portal... ";
+ if ($g['platform'] != "pfSense") {
+ /* restore the vouchers, if we have them */
+ if (file_exists("{$g['cf_conf_path']}/vouchers.tgz")) {
+ $voucherrestore = "";
+ $voucherreturn = "";
+ exec("cd /;LANG=C /usr/bin/tar -xzf {$g['cf_conf_path']}/vouchers.tgz 2>&1", $voucherrestore, $voucherreturn);
+ $voucherrestore = implode(" ", $voucherrestore);
+ if($voucherreturn <> 0) {
+ log_error("Voucher restore failed exited with $voucherreturn, the error is: $voucherrestore\n");
+ }
+ }
+ }
+ }
/* kill any running mini_httpd */
killbypid("{$g['varrun_path']}/lighty-CaptivePortal.pid");
OpenPOWER on IntegriCloud