Skip to content

Commit

Permalink
T2546: re-add "monitor command" op-mode command with a new "diff" opt…
Browse files Browse the repository at this point in the history
…ion as well
  • Loading branch information
c-po committed Sep 1, 2023
1 parent 18a6163 commit b92515d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
28 changes: 28 additions & 0 deletions op-mode-definitions/monitor-command.xml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0"?>
<interfaceDefinition>
<node name="monitor">
<children>
<tagNode name="command">
<properties>
<help>Monitor operational mode command (refreshes every 2 seconds)</help>
</properties>
<command>watch --no-title ${vyos_op_scripts_dir}/vyos-op-cmd-wrapper.sh ${@:3}</command>
</tagNode>
<node name="command">
<children>
<node name="diff">
<properties>
<help>Show differences during each run</help>
</properties>
</node>
<tagNode name="diff">
<properties>
<help>Monitor operational mode command (refreshes every 2 seconds)</help>
</properties>
<command>watch --no-title --differences ${vyos_op_scripts_dir}/vyos-op-cmd-wrapper.sh ${@:4}</command>
</tagNode>
</children>
</node>
</children>
</node>
</interfaceDefinition>
6 changes: 6 additions & 0 deletions src/op_mode/vyos-op-cmd-wrapper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/vbash
shopt -s expand_aliases
source /etc/default/vyatta
source /etc/bash_completion.d/vyatta-op
_vyatta_op_init
_vyatta_op_run "$@"

0 comments on commit b92515d

Please sign in to comment.