Skip to content

Commit

Permalink
wireless: T6462: add op-mode command for hostapd and wpa_supplicant logs
Browse files Browse the repository at this point in the history
* monitor log wireless hostapd [interface <name>]
* monitor log wireless wpa-supplicant [interface <name>]
* show log wireless hostapd [interface <name>]
* show log wireless wpa-supplicant [interface <name>]

(cherry picked from commit 7ed4abe)
  • Loading branch information
c-po authored and mergify[bot] committed Jun 11, 2024
1 parent 682defd commit da27707
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 0 deletions.
41 changes: 41 additions & 0 deletions op-mode-definitions/monitor-log.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,47 @@
</properties>
<command>journalctl --no-hostname --boot --follow --unit keepalived.service</command>
</leafNode>
<node name="wireless">
<properties>
<help>Monitor last lines of Wireless interface log</help>
</properties>
<children>
<node name="wpa-supplicant">
<properties>
<help>Monitor last lines of WPA supplicant</help>
</properties>
<command>if cli-shell-api existsActive interfaces wireless; then journalctl --no-hostname --boot --follow --unit "wpa_supplicant@*.service"; else echo "No wireless interface configured!"; fi</command>
<children>
<tagNode name="interface">
<properties>
<help>Monitor last lines of specific wireless interface supplicant</help>
<completionHelp>
<path>interfaces wireless</path>
</completionHelp>
</properties>
<command>if [[ $(cli-shell-api returnActiveValue interfaces wireless $6 type) == "station" ]]; then journalctl --no-hostname --boot --follow --unit "wpa_supplicant@$6.service"; else echo "Wireless interface $6 not configured as station!"; fi</command>
</tagNode>
</children>
</node>
<node name="hostapd">
<properties>
<help>Monitor last lines of host access point daemon</help>
</properties>
<command>if cli-shell-api existsActive interfaces wireless; then journalctl --no-hostname --boot --follow --unit "hostapd@*.service"; else echo "No wireless interface configured!"; fi</command>
<children>
<tagNode name="interface">
<properties>
<help>Monitor last lines of specific host access point interface</help>
<completionHelp>
<path>interfaces wireless</path>
</completionHelp>
</properties>
<command>if [[ $(cli-shell-api returnActiveValue interfaces wireless $6 type) == "access-point" ]]; then journalctl --no-hostname --boot --follow --unit "hostapd@$6.service"; else echo "Wireless interface $6 not configured as access-point!"; fi</command>
</tagNode>
</children>
</node>
</children>
</node>
</children>
</node>
</children>
Expand Down
41 changes: 41 additions & 0 deletions op-mode-definitions/show-log.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,47 @@
</properties>
<command>journalctl --no-hostname --boot --unit keepalived.service</command>
</leafNode>
<node name="wireless">
<properties>
<help>Show log for Wireless interface</help>
</properties>
<children>
<node name="wpa-supplicant">
<properties>
<help>Show log for WPA supplicant</help>
</properties>
<command>if cli-shell-api existsActive interfaces wireless; then journalctl --no-hostname --boot --unit "wpa_supplicant@*.service"; else echo "No wireless interface configured!"; fi</command>
<children>
<tagNode name="interface">
<properties>
<help>Show log for specific wireless interface supplicant</help>
<completionHelp>
<path>interfaces wireless</path>
</completionHelp>
</properties>
<command>if [[ $(cli-shell-api returnActiveValue interfaces wireless $6 type) == "station" ]]; then journalctl --no-hostname --boot --unit "wpa_supplicant@$6.service"; else echo "Wireless interface $6 not configured as station!"; fi</command>
</tagNode>
</children>
</node>
<node name="hostapd">
<properties>
<help>Show log for host access point daemon</help>
</properties>
<command>if cli-shell-api existsActive interfaces wireless; then journalctl --no-hostname --boot --unit "hostapd@*.service"; else echo "No wireless interface configured!"; fi</command>
<children>
<tagNode name="interface">
<properties>
<help>Show log for specific host access point daemon interface</help>
<completionHelp>
<path>interfaces wireless</path>
</completionHelp>
</properties>
<command>if [[ $(cli-shell-api returnActiveValue interfaces wireless $6 type) == "access-point" ]]; then journalctl --no-hostname --boot --unit "hostapd@$6.service"; else echo "Wireless interface $6 not configured as access-point!"; fi</command>
</tagNode>
</children>
</node>
</children>
</node>
<leafNode name="webproxy">
<properties>
<help>Show log for Webproxy</help>
Expand Down

0 comments on commit da27707

Please sign in to comment.