From c48486cacfd1b690627a942ef25abee68c4b3ef6 Mon Sep 17 00:00:00 2001 From: fbt Date: Sat, 16 Dec 2017 00:36:32 +0300 Subject: [PATCH] just some silly refactoring Signed-off-by: fbt --- ssm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ssm b/ssm index 7ca191b..e361f28 100755 --- a/ssm +++ b/ssm @@ -415,10 +415,9 @@ main() { svc_pidfile="$rundir/$service_name.pid" # Get the service defaults - for p in "${cfg_path[@]}"; do - [[ -f "$p/conf.d/$service_name" ]] && { - source "$p/conf.d/$service_name" || die 5 "Failed to read service defaults: $p/conf.d/$service_name" - break + for p in "${cfg_path[@]/%//$service_name}"; do + [[ -f "$p" ]] && { + source "$p" || die 5 "Failed to read service defaults: $p" } done @@ -431,7 +430,6 @@ main() { [[ "$service_type" == 'oneshot' ]] && service_oneshot=1 (( service_oneshot )) && service_managed=0 - [[ "$service_pidfile" ]] && service_managed=0 if ! (( service_managed )); then