From 9c568a3455963ae1a726c7d98b04821492dd5bdb Mon Sep 17 00:00:00 2001 From: fatalerrors Date: Wed, 29 Sep 2021 12:27:19 +0200 Subject: [PATCH 1/2] updated documentation --- doc/dev.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/doc/dev.md b/doc/dev.md index 00a3392..ce7d746 100644 --- a/doc/dev.md +++ b/doc/dev.md @@ -223,4 +223,36 @@ and is privileged. ### 6.2. Functions #### 6.2.1. exec_serv +That function execute the given action to the given service. The service have +to be the first parameter and the action, the second parameter. No more +parameter will be acceted and an error will be triggered if there's any more +than two. + +The function returns the exit code of the service command. + +#### 6.2.2. svc_start +Start the services given in parmeters. You can give as many services you want. + +That function relies on the previously documented exec_serv function. + +#### 6.2.3. svc_reload +Reload the configuration of the services given in parmeters. You can give as +many services you want. Be careful using this as some services don't have that +capability. + +That function relies on the previously documented exec_serv function. + +#### 6.2.2. svc_restart +Restart the services given in parmeters. It consist generally in a stop +immediately followed by a start. You can give as many services you want. + +That function relies on the previously documented exec_serv function. + +#### 6.2.3. svc_stop +Stop the services given in parmeters. You can give as many services you want. + +That function relies on the previously documented exec_serv function. + +### 6.3. Other functionnalities +That file don't profide any other things that the previously listed functions. From 0a2c9f5bc3d32cd765a3c67aa81e060c9ec28426 Mon Sep 17 00:00:00 2001 From: fatalerrors Date: Wed, 6 Oct 2021 10:35:11 +0200 Subject: [PATCH 2/2] services.sh: added svc_reload --- lib/services.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/services.sh b/lib/services.sh index 98776b1..1e2eb1e 100644 --- a/lib/services.sh +++ b/lib/services.sh @@ -27,6 +27,7 @@ exec_serv() -e s/%com%/$command/) prnt I "Lancement de la commande $command du services $svcname" $lineexec + return $? } export exec_serv @@ -42,6 +43,17 @@ svc_start() export -f svc_start +# ------------------------------------------------------------------------------ +# Reload one or more services +svc_reload() +{ + for svc in $@; do + exec_serv $svc reload + done +} +export -f svc_reload + + # ------------------------------------------------------------------------------ # Restart one or more services svc_restart()