Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions net/wol/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PLUGIN_NAME= wol
PLUGIN_VERSION= 2.5
Comment thread
touzenesmy marked this conversation as resolved.
Outdated
PLUGIN_REVISION= 4
PLUGIN_REVISION= 5
Comment thread
touzenesmy marked this conversation as resolved.
Outdated
PLUGIN_DEPENDS= wol
PLUGIN_COMMENT= Wake on LAN Service

.include "../../Mk/plugins.mk"
.include "../../Mk/plugins.mk"
Comment thread
touzenesmy marked this conversation as resolved.
Outdated
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ private function wakeHostByNode($wolent, &$result)
return $result;
}
$broadcast_ip = escapeshellarg($this->calculateSubnetBroadcast($ipaddr, $cidr));
$result['status'] = trim($backend->configdRun("wol wake {$broadcast_ip} " . escapeshellarg((string)$wolent->mac)));
$port = escapeshellarg((string)$wolent->port);
$mac = escapeshellarg((string)$wolent->mac);
$result['status'] = trim($backend->configdRun("wol wake {$port} {$broadcast_ip} {$mac}"));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to be rewritten for configdpRun() second argument is the array with all unescaped values.. ideally from getValue() and not string cast

}

private function getInterfaceIP($if)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,16 @@
<type>text</type>
<help>Enter a MAC address in the following format: xx:xx:xx:xx:xx:xx</help>
</field>
<field>
<id>host.port</id>
<label>UDP port</label>
<type>text</type>
<help>UDP port to send the magic packet to (1-65535). Defaults to 9.</help>
Comment thread
touzenesmy marked this conversation as resolved.
Outdated
</field>
<field>
<id>host.descr</id>
<label>Description</label>
<type>text</type>
<help>You may enter a description here for your reference (not parsed).</help>
</field>
</form>
</form>
Comment thread
touzenesmy marked this conversation as resolved.
Outdated
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,10 @@
<type>text</type>
<help>Enter a MAC address in the following format: xx:xx:xx:xx:xx:xx.</help>
</field>
</form>
<field>
<id>wake.port</id>
<label>UDP port</label>
<type>text</type>
<help>UDP port to send the magic packet to (1-65535). Defaults to 9.</help>
Comment thread
touzenesmy marked this conversation as resolved.
Outdated
</field>
</form>
Comment thread
touzenesmy marked this conversation as resolved.
Outdated
11 changes: 9 additions & 2 deletions net/wol/src/opnsense/mvc/app/models/OPNsense/Wol/Wol.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<model>
<mount>//wol</mount>
<description>Wake On Lan configuration</description>
<version>1.0.0</version>
<version>1.0.1</version>
<items>
<wolentry type="ArrayField">
<interface type="InterfaceField">
Expand All @@ -16,7 +16,14 @@
<Default>00:00:00:00:00:00</Default>
<ValidationMessage>Should be 6 groups of 2 hex characters (a-fA-F0-9) separated by ':'.</ValidationMessage>
</mac>
<port type="IntegerField">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, will be in next commit. Thanks for the input !

<Required>Y</Required>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the issue with requiring this is now the user needs to input it or else validation fails. "9" isn't added automatically and the migration uses '4000' which would be automatic if we used that default ;)

@touzenesmy touzenesmy Jun 3, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, in my testing 9 is prefilled automatically. Are you sure about that ?
EDIT: Just tested and it does prefill correctly
image
image

<Default>9</Default>
<MinimumValue>1</MinimumValue>
<MaximumValue>65535</MaximumValue>
<ValidationMessage>UDP port must be an integer between 1 and 65535.</ValidationMessage>
</port>
<descr type="TextField"/>
</wolentry>
</items>
</model>
</model>
Comment thread
touzenesmy marked this conversation as resolved.
Outdated
6 changes: 3 additions & 3 deletions net/wol/src/opnsense/service/conf/actions.d/actions_wol.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[wake]
command:/usr/local/bin/wol -i
parameters: %s %s
command:/usr/local/bin/wol
parameters: -p %s -i %s %s
type:script
description:Wake-On-LAN for host with broadcast IP and MAC
Comment thread
touzenesmy marked this conversation as resolved.
Outdated
message:Waking up host %s %s
message:Waking up host on port %s with broadcast %s mac %s
Comment thread
touzenesmy marked this conversation as resolved.
Outdated