aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2011-10-30 14:45:30 +0000
committerColin Guthrie <colin@mageia.org>2011-10-30 14:45:30 +0000
commite5b5714cf652c747f2121656139cc1972c677375 (patch)
tree19445083ec353f63070f6bf3188616448c57759a
parent2ac7b326db9861f0d8547da06e15a320a7147691 (diff)
downloadrpm-helper-e5b5714cf652c747f2121656139cc1972c677375.tar
rpm-helper-e5b5714cf652c747f2121656139cc1972c677375.tar.gz
rpm-helper-e5b5714cf652c747f2121656139cc1972c677375.tar.bz2
rpm-helper-e5b5714cf652c747f2121656139cc1972c677375.tar.xz
rpm-helper-e5b5714cf652c747f2121656139cc1972c677375.zip
Remove early exit and replace with conditionals to improve readability
-rwxr-xr-xadd-service24
1 files 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
}