summaryrefslogtreecommitdiff
path: root/src/op_mode
diff options
context:
space:
mode:
Diffstat (limited to 'src/op_mode')
-rwxr-xr-xsrc/op_mode/container.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/op_mode/container.py b/src/op_mode/container.py
index 02d4a13b7..78d42f800 100755
--- a/src/op_mode/container.py
+++ b/src/op_mode/container.py
@@ -64,6 +64,17 @@ def show_network(raw: bool):
return cmd(command)
+def restart(name: str):
+ from vyos.util import rc_cmd
+
+ rc, output = rc_cmd(f'sudo podman restart {name}')
+ if rc != 0:
+ print(output)
+ return None
+ print(f'Container name "{name}" restarted!')
+ return output
+
+
if __name__ == '__main__':
try:
res = vyos.opmode.run(sys.modules[__name__])