From e5b5714cf652c747f2121656139cc1972c677375 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Sun, 30 Oct 2011 14:45:30 +0000 Subject: Remove early exit and replace with conditionals to improve readability --- add-service | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/add-service b/add-service index 96f515c..654f7c9 100755 --- a/add-service +++ b/add-service @@ -47,21 +47,19 @@ add_chkconfig_service() { fi if [ -n "$srv" ]; then /sbin/chkconfig --add $srv - else - exit 0 - fi - if [ -r /etc/sysconfig/system ]; then - . /etc/sysconfig/system - fi + if [ -r /etc/sysconfig/system ]; then + . /etc/sysconfig/system + fi - # TODO what to do with system units here? - if [ -z "$ADD_SERVICES_TO_CURRENT_PROFILE_ONLY" ]; then - # add the service to all the profiles at once - if [ -d /etc/netprofile/profiles/default/services ]; then - for dir in /etc/netprofile/profiles/*/services; do - touch $dir/$srv - done + # TODO what to do with system units here? + if [ -z "$ADD_SERVICES_TO_CURRENT_PROFILE_ONLY" ]; then + # add the service to all the profiles at once + if [ -d /etc/netprofile/profiles/default/services ]; then + for dir in /etc/netprofile/profiles/*/services; do + touch $dir/$srv + done + fi fi fi } -- cgit v1.2.1