From f773368df7c5eb40a8c6334ebbed2de88bdb21af Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Tue, 16 Jul 2024 21:28:55 +0200 Subject: op-mode: T6577: create generic service restart helper to work with the API Right now we have multiple restart helpers (e.g. dhcp server, ssh, ntp) that all do the same (more or less): * Check if service is configured on CLI * Restart if configured * Error out if unconfigured This is not available via the op-mode API. Create a new restart.py op-mode helper that takes the service name and possible VRF as argument so it's also exposed via API. (cherry picked from commit c74ae852152b0c3c3f00a1847d081d28f500e178) --- op-mode-definitions/webproxy.xml.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'op-mode-definitions/webproxy.xml.in') diff --git a/op-mode-definitions/webproxy.xml.in b/op-mode-definitions/webproxy.xml.in index 57df44ff8..ba13907b8 100644 --- a/op-mode-definitions/webproxy.xml.in +++ b/op-mode-definitions/webproxy.xml.in @@ -34,7 +34,7 @@ Restart WebProxy service - if cli-shell-api existsActive service webproxy; then sudo systemctl restart squid.service; else echo "Service WebProxy not configured"; fi + sudo ${vyos_op_scripts_dir}/restart.py restart_service --name webproxy -- cgit v1.2.3