summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--op-mode-definitions/generate-ipsec-debug-archive.xml.in2
-rwxr-xr-xsrc/op_mode/generate_ipsec_debug_archive.py25
2 files changed, 13 insertions, 14 deletions
diff --git a/op-mode-definitions/generate-ipsec-debug-archive.xml.in b/op-mode-definitions/generate-ipsec-debug-archive.xml.in
index dcbed0c42..a9ce113d1 100644
--- a/op-mode-definitions/generate-ipsec-debug-archive.xml.in
+++ b/op-mode-definitions/generate-ipsec-debug-archive.xml.in
@@ -8,7 +8,7 @@
<properties>
<help>Generate IPSec debug-archive</help>
</properties>
- <command>${vyos_op_scripts_dir}/generate_ipsec_debug_archive.py</command>
+ <command>sudo ${vyos_op_scripts_dir}/generate_ipsec_debug_archive.py</command>
</node>
</children>
</node>
diff --git a/src/op_mode/generate_ipsec_debug_archive.py b/src/op_mode/generate_ipsec_debug_archive.py
index 933dd4e1a..1422559a8 100755
--- a/src/op_mode/generate_ipsec_debug_archive.py
+++ b/src/op_mode/generate_ipsec_debug_archive.py
@@ -24,20 +24,19 @@ from vyos.util import rc_cmd
# define a list of commands that needs to be executed
CMD_LIST: list[str] = [
- 'sudo ipsec status',
- 'sudo swanctl -L',
- 'sudo swanctl -l',
- 'sudo swanctl -P',
- 'sudo ip x sa show',
- 'sudo ip x policy show',
- 'sudo ip tunnel show',
- 'sudo ip address',
- 'sudo ip rule show',
- 'sudo ip route | head -100',
- 'sudo ip route show table 220'
+ 'ipsec status',
+ 'swanctl -L',
+ 'swanctl -l',
+ 'swanctl -P',
+ 'ip x sa show',
+ 'ip x policy show',
+ 'ip tunnel show',
+ 'ip address',
+ 'ip rule show',
+ 'ip route | head -100',
+ 'ip route show table 220'
]
-JOURNALCTL_CMD: str = 'sudo journalctl -b -n 10000 /usr/lib/ipsec/charon'
-
+JOURNALCTL_CMD: str = 'journalctl -b -n 10000 /usr/lib/ipsec/charon'
# execute a command and save the output to a file
def save_stdout(command: str, file: Path) -> None: