Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
99c71c85
Commit
99c71c85
authored
Feb 17, 2017
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firmware: plugin detection via configd
parent
9d73770c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
4 deletions
+54
-4
plist
plist
+1
-0
plugin.sh
src/opnsense/scripts/firmware/plugin.sh
+43
-0
actions_firmware.conf
src/opnsense/service/conf/actions.d/actions_firmware.conf
+6
-0
status_dhcp_leases.php
src/www/status_dhcp_leases.php
+4
-4
No files found.
plist
View file @
99c71c85
...
@@ -545,6 +545,7 @@
...
@@ -545,6 +545,7 @@
/usr/local/opnsense/scripts/firmware/launcher.sh
/usr/local/opnsense/scripts/firmware/launcher.sh
/usr/local/opnsense/scripts/firmware/license.sh
/usr/local/opnsense/scripts/firmware/license.sh
/usr/local/opnsense/scripts/firmware/lock.sh
/usr/local/opnsense/scripts/firmware/lock.sh
/usr/local/opnsense/scripts/firmware/plugin.sh
/usr/local/opnsense/scripts/firmware/reinstall.sh
/usr/local/opnsense/scripts/firmware/reinstall.sh
/usr/local/opnsense/scripts/firmware/remove.sh
/usr/local/opnsense/scripts/firmware/remove.sh
/usr/local/opnsense/scripts/firmware/running.sh
/usr/local/opnsense/scripts/firmware/running.sh
...
...
src/opnsense/scripts/firmware/plugin.sh
0 → 100755
View file @
99c71c85
#!/bin/sh
# Copyright (c) 2017 Franco Fichtner <franco@opnsense.org>
#
# 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 BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
PLUGIN
=
${
1
}
PREFIX
=
"os-"
SUFFIX
=
"-devel"
RETURN
=
"0"
# Return "1" if the plugin is installed. It will fuzzy-match the
# development version, unless specifically given the development
# version (os-plugin-devel-devel doesn't match obviously).
if
pkg query %n
"
${
PREFIX
}${
PLUGIN
}
"
>
/dev/null
;
then
RETURN
=
"1"
elif
pkg query %n
"
${
PREFIX
}${
PLUGIN
}${
SUFFIX
}
"
>
/dev/null
;
then
RETURN
=
"1"
fi
echo
${
RETURN
}
src/opnsense/service/conf/actions.d/actions_firmware.conf
View file @
99c71c85
...
@@ -89,6 +89,12 @@ parameters:%s
...
@@ -89,6 +89,12 @@ parameters:%s
type
:
script
type
:
script
message
:
issued
firmware
hotfix
for
%
s
message
:
issued
firmware
hotfix
for
%
s
[
plugin
]
command
: /
usr
/
local
/
opnsense
/
scripts
/
firmware
/
plugin
.
sh
parameters
:%
s
type
:
script_output
message
:
Tested
for
presence
of
plugin
%
s
[
status
]
[
status
]
command
: /
usr
/
bin
/
touch
/
tmp
/
pkg_upgrade
.
progress
2
>&
1
; /
bin
/
cat
/
tmp
/
pkg_upgrade
.
progress
2
>&
1
command
: /
usr
/
bin
/
touch
/
tmp
/
pkg_upgrade
.
progress
2
>&
1
; /
bin
/
cat
/
tmp
/
pkg_upgrade
.
progress
2
>&
1
parameters
:
parameters
:
...
...
src/www/status_dhcp_leases.php
View file @
99c71c85
...
@@ -76,8 +76,8 @@ function remove_duplicate($array, $field)
...
@@ -76,8 +76,8 @@ function remove_duplicate($array, $field)
$interfaces
=
legacy_config_get_interfaces
(
array
(
'virtual'
=>
false
));
$interfaces
=
legacy_config_get_interfaces
(
array
(
'virtual'
=>
false
));
$leasesfile
=
services_dhcpd_leasesfile
();
$leasesfile
=
services_dhcpd_leasesfile
();
/* Check if WOL plugin is installed */
$
plugin_installed
=
count
(
plugins_scan
(
'
wol'
));
$
wol_installed
=
trim
(
configd_run
(
'firmware plugin
wol'
));
if
(
$_SERVER
[
'REQUEST_METHOD'
]
===
'GET'
)
{
if
(
$_SERVER
[
'REQUEST_METHOD'
]
===
'GET'
)
{
$awk
=
"/usr/bin/awk"
;
$awk
=
"/usr/bin/awk"
;
...
@@ -420,7 +420,7 @@ include("head.inc");?>
...
@@ -420,7 +420,7 @@ include("head.inc");?>
<td><?=
$data['ip']
;?></td>
<td><?=
$data['ip']
;?></td>
<td>
<td>
<?php
<?php
if (
$
plugin
_installed
): ?>
if (
$
wol
_installed
): ?>
<a href="
services_wol
.
php
?
if
=<?=
$data
[
'if'
];
?>
&
mac=
<?=
$data
[
'mac'
];
?>
" title="
<?=
gettext
(
"send Wake on LAN packet to this MAC address"
);
?>
">
<a href="
services_wol
.
php
?
if
=<?=
$data
[
'if'
];
?>
&
mac=
<?=
$data
[
'mac'
];
?>
" title="
<?=
gettext
(
"send Wake on LAN packet to this MAC address"
);
?>
">
<?=
$data
[
'mac'
];
?>
<?=
$data
[
'mac'
];
?>
</a>
</a>
...
@@ -447,7 +447,7 @@ include("head.inc");?>
...
@@ -447,7 +447,7 @@ include("head.inc");?>
<?php
<?php
endif
;
?>
endif
;
?>
<?php
<?php
if
(
$
plugin
_installed
)
:
?>
if
(
$
wol
_installed
)
:
?>
<a
class=
"btn btn-default btn-xs"
href=
"services_wol_edit.php?if=
<?=
$data
[
'if'
];
?>
&mac=
<?=
$data
[
'mac'
];
?>
&descr=
<?=
$data
[
'hostname'
];
?>
"
>
<a
class=
"btn btn-default btn-xs"
href=
"services_wol_edit.php?if=
<?=
$data
[
'if'
];
?>
&mac=
<?=
$data
[
'mac'
];
?>
&descr=
<?=
$data
[
'hostname'
];
?>
"
>
<span
class=
"glyphicon glyphicon-flash"
data-toggle=
"tooltip"
title=
"
<?=
gettext
(
"add a Wake on LAN mapping for this MAC address"
);
?>
"
alt=
"add"
></span>
<span
class=
"glyphicon glyphicon-flash"
data-toggle=
"tooltip"
title=
"
<?=
gettext
(
"add a Wake on LAN mapping for this MAC address"
);
?>
"
alt=
"add"
></span>
</a>
</a>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment