summaryrefslogtreecommitdiff
path: root/src/op_mode
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-12-02 09:44:25 +0100
committerChristian Poessinger <christian@poessinger.com>2022-12-02 09:44:33 +0100
commitc2a5957a942c8f6070b8f6ff12764e90c1a4c237 (patch)
tree7397b95351d2bbe329db77160cad855f63c79dc6 /src/op_mode
parentaec5295551efdaf6ba82b127d2fd6a6f1fcbf365 (diff)
downloadvyos-1x-c2a5957a942c8f6070b8f6ff12764e90c1a4c237.tar.gz
vyos-1x-c2a5957a942c8f6070b8f6ff12764e90c1a4c237.zip
op-mode: T4767: drop sudo calls
It's easier and more obvious if the script is called with sudo itself and not spawning a sudo sessionf or each individual command.
Diffstat (limited to 'src/op_mode')
-rwxr-xr-xsrc/op_mode/generate_ipsec_debug_archive.py25
1 files changed, 12 insertions, 13 deletions
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: