From 7f1bd75ee6aaffddf47e704c46fbab5396b7dd19 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Thu, 30 Jul 2009 09:49:49 -0700 Subject: Shutdown non-rc.conf daemons first Flip the order in which daemons are shutdown. First we scan for all daemons that are NOT in rc.conf and shut those down (order is based on ls, so it is dependent on LC_COLLATE). Afterwards, we shut down all daemons in rc.conf, in order Signed-off-by: Aaron Griffin --- functions | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'functions') diff --git a/functions b/functions index 1d51345..f84fb5e 100644 --- a/functions +++ b/functions @@ -130,6 +130,20 @@ status() { fi } +# usage : in_array( $needle, $haystack ) +# return : 0 - found +# 1 - not found +# Copied from makepkg +in_array() { + local needle=$1; shift + [ -z "$1" ] && return 1 # Not Found + local item + for item in "$@"; do + [ "$item" = "$needle" ] && return 0 # Found + done + return 1 # Not Found +} + # daemons: add_daemon() { -- cgit v1.2.3