From b92515dc815959a4efe05e33b0bb8ee9130c40e4 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Fri, 1 Sep 2023 07:43:18 +0200 Subject: T2546: re-add "monitor command" op-mode command with a new "diff" option as well --- op-mode-definitions/monitor-command.xml.in | 28 ++++++++++++++++++++++++++++ src/op_mode/vyos-op-cmd-wrapper.sh | 6 ++++++ 2 files changed, 34 insertions(+) create mode 100644 op-mode-definitions/monitor-command.xml.in create mode 100755 src/op_mode/vyos-op-cmd-wrapper.sh diff --git a/op-mode-definitions/monitor-command.xml.in b/op-mode-definitions/monitor-command.xml.in new file mode 100644 index 000000000..31c68f029 --- /dev/null +++ b/op-mode-definitions/monitor-command.xml.in @@ -0,0 +1,28 @@ + + + + + + + Monitor operational mode command (refreshes every 2 seconds) + + watch --no-title ${vyos_op_scripts_dir}/vyos-op-cmd-wrapper.sh ${@:3} + + + + + + Show differences during each run + + + + + Monitor operational mode command (refreshes every 2 seconds) + + watch --no-title --differences ${vyos_op_scripts_dir}/vyos-op-cmd-wrapper.sh ${@:4} + + + + + + diff --git a/src/op_mode/vyos-op-cmd-wrapper.sh b/src/op_mode/vyos-op-cmd-wrapper.sh new file mode 100755 index 000000000..a89211b2b --- /dev/null +++ b/src/op_mode/vyos-op-cmd-wrapper.sh @@ -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 "$@" -- cgit v1.2.3