in_array() strips '@' and therefore the name is missleading.
For checking DAEMONS, ck_autostart() should be used.
---
 functions |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/functions b/functions
index 6efcd52..caa9060 100644
--- a/functions
+++ b/functions
@@ -162,10 +162,15 @@ status() {
        return $ret
 }
 
-#  usage : in_array( $needle, $haystack )
+# This is deprecated!
+# It strips '@' and therefore the name is missleading.
+# For checking DAEMONS, ck_autostart() should be used!
+#
+#  usage : is_in_array( $needle, $haystack )
 # return : 0 - found
 #          1 - not found
 in_array() {
+       echo "WARNING: Call to deprecated function in_array() from $0" >&2
        local needle=$1; shift
        local item
        for item; do
@@ -272,7 +277,7 @@ stop_all_daemons() {
        for daemon in /run/daemons/*; do
                [[ -f $daemon ]] || continue
                daemon=${daemon##*/}
-               in_array "$daemon" "${DAEMONS[@]}" || stop_daemon "$daemon"
+               ck_autostart "$daemon" && stop_daemon "$daemon"
        done
 
        # Shutdown daemons in reverse order
-- 
1.7.1

Reply via email to