plugins: remove spurious rc.plugins_configure

Prodded by: @adschellevis
This commit is contained in:
Franco Fichtner 2018-03-20 11:05:58 +01:00
parent 2f12b3dc55
commit a458aec929
5 changed files with 55 additions and 58 deletions

1
plist
View File

@ -123,7 +123,6 @@
/usr/local/etc/rc.newwanip
/usr/local/etc/rc.newwanipv6
/usr/local/etc/rc.openvpn
/usr/local/etc/rc.plugins_configure
/usr/local/etc/rc.reboot
/usr/local/etc/rc.reload_all
/usr/local/etc/rc.reload_interfaces

View File

@ -1,48 +0,0 @@
#!/usr/local/bin/php
<?php
/*
* Copyright (C) 2017 Alexander Shursha <kekek2@ya.ru>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
require_once 'config.inc';
require_once 'util.inc';
require_once 'system.inc';
require_once 'interfaces.inc';
require_once 'filter.inc';
require_once 'services.inc';
require_once 'auth.inc';
require_once 'rrd.inc';
if (!empty($argv[1])) {
/* we have a hook specified, copy args */
$args = $argv;
/* first argument is command */
array_shift($args);
/* second argument is hook */
$hook = array_shift($args);
/* other arguments are passed as is */
plugins_configure($hook, true, $args);
}

View File

@ -1,5 +1,5 @@
[configure]
command:/usr/local/etc/rc.plugins_configure
command:/usr/local/sbin/pluginctl
parameters:%s %s
type:script
message:Running plugin configuration %s %s

View File

@ -1,7 +1,7 @@
[start]
command:
/usr/local/opnsense/scripts/proxy/setup.sh;
/usr/local/etc/rc.plugins_configure webproxy start;
/usr/local/sbin/pluginctl webproxy start;
/usr/local/etc/rc.d/squid start
parameters:
type:script
@ -11,7 +11,7 @@ message:starting proxy
command:
/usr/local/etc/rc.d/squid stop;
/usr/bin/killall squid;
/usr/local/etc/rc.plugins_configure webproxy stop;
/usr/local/sbin/pluginctl webproxy stop;
exit 0
parameters:
type:script
@ -20,7 +20,7 @@ message:stopping proxy
[restart]
command:
/usr/local/opnsense/scripts/proxy/setup.sh;
/usr/local/etc/rc.plugins_configure webproxy restart;
/usr/local/sbin/pluginctl webproxy restart;
/usr/local/etc/rc.d/squid restart
parameters:
type:script
@ -28,7 +28,7 @@ message:restarting proxy
[reload]
command:
/usr/local/etc/rc.plugins_configure webproxy reload;
/usr/local/sbin/pluginctl webproxy reload;
/usr/local/etc/rc.d/squid reload
parameters:
type:script
@ -43,7 +43,7 @@ message:request proxy status
[fetchacls]
command:
/usr/local/opnsense/scripts/proxy/fetchACLs.py && (
/usr/local/etc/rc.plugins_configure webproxy reload;
/usr/local/sbin/pluginctl webproxy reload;
/usr/local/etc/rc.d/squid reload
)
parameters:

View File

@ -1,4 +1,50 @@
#!/bin/sh
#!/usr/local/bin/php
<?php
# launch the real utility from here
/usr/local/etc/rc.plugins_configure "${@}"
/*
* Copyright (C) 2017 Alexander Shursha <kekek2@ya.ru>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
require_once 'config.inc';
require_once 'util.inc';
require_once 'system.inc';
require_once 'interfaces.inc';
require_once 'filter.inc';
require_once 'services.inc';
require_once 'auth.inc';
require_once 'rrd.inc';
if (!empty($argv[1])) {
/* we have a hook specified, copy args */
$args = $argv;
/* first argument is command */
array_shift($args);
/* second argument is hook */
$hook = array_shift($args);
/* other arguments are passed as is */
plugins_configure($hook, true, $args);
} else {
echo "Nothing to do.\n";
}