Skip to content

Commit b769f35

Browse files
committed
web proxy: tweak plugin code a bit
o Add license for new file by Alex o Use the argument to pass the type of action to simplify o Stop after squid stop for symmetry with start to retain order
1 parent 4cd0400 commit b769f35

File tree

4 files changed

+33
-5
lines changed

4 files changed

+33
-5
lines changed

LICENSE

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Copyright (c) 2014-2017 Ad Schellevis <[email protected]>
2+
Copyright (c) 2017 Alexander Shursha <[email protected]>
23
Copyright (c) 2004 Bachman Kharazmi
34
Copyright (c) 2005-2008 Bill Marquette <[email protected]>
45
Copyright (c) 2003-2005 Bob Zoller <[email protected]>

plist

+1
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,7 @@
549549
/usr/local/opnsense/scripts/OPNsense/CaptivePortal/set_session_restrictions.py
550550
/usr/local/opnsense/scripts/OPNsense/CaptivePortal/sql/init.sql
551551
/usr/local/opnsense/scripts/OPNsense/CaptivePortal/strip_template.py
552+
/usr/local/opnsense/scripts/OPNsense/Proxy/plugins.php
552553
/usr/local/opnsense/scripts/dhcp/get_leases.py
553554
/usr/local/opnsense/scripts/dns/unbound_dhcpd.py
554555
/usr/local/opnsense/scripts/filter/delete_table.py

src/opnsense/mvc/app/controllers/OPNsense/Proxy/Api/ServiceController.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
2-
/**
2+
3+
/*
34
* Copyright (C) 2015 Deciso B.V.
4-
*
55
* All rights reserved.
66
*
77
* Redistribution and use in source and binary forms, with or without
@@ -24,8 +24,8 @@
2424
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2525
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2626
* POSSIBILITY OF SUCH DAMAGE.
27-
*
2827
*/
28+
2929
namespace OPNsense\Proxy\Api;
3030

3131
use \OPNsense\Base\ApiControllerBase;
@@ -62,8 +62,8 @@ public function stopAction()
6262
{
6363
if ($this->request->isPost()) {
6464
$backend = new Backend();
65-
$backend->configdRun('proxy plugins stop');
6665
$response = $backend->configdRun("proxy stop");
66+
$backend->configdRun('proxy plugins stop');
6767
return array("response" => $response);
6868
} else {
6969
return array("response" => array());
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,35 @@
11
#!/usr/local/bin/php
22
<?php
33

4+
/*
5+
* Copyright (C) 2017 Alexander Shursha <[email protected]>
6+
* All rights reserved.
7+
*
8+
* Redistribution and use in source and binary forms, with or without
9+
* modification, are permitted provided that the following conditions are met:
10+
*
11+
* 1. Redistributions of source code must retain the above copyright notice,
12+
* this list of conditions and the following disclaimer.
13+
*
14+
* 2. Redistributions in binary form must reproduce the above copyright
15+
* notice, this list of conditions and the following disclaimer in the
16+
* documentation and/or other materials provided with the distribution.
17+
*
18+
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
19+
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
20+
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21+
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
22+
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27+
* POSSIBILITY OF SUCH DAMAGE.
28+
*/
29+
430
require_once("config.inc");
531
require_once("plugins.inc");
632

733
if (isset($argv[1])) {
8-
plugins_configure("webproxy_" . trim($argv[1], " \n"));
34+
plugins_configure('webproxy', array(trim($argv[1], " \n")));
935
}

0 commit comments

Comments
 (0)