aboutsummaryrefslogtreecommitdiffstats
path: root/add-service
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2011-10-30 14:47:55 +0000
committerColin Guthrie <colin@mageia.org>2011-10-30 14:47:55 +0000
commit751f55f6a09a18bcb6ffab577256d93824ee29cc (patch)
tree0960aa4a2123e7773e51a9b99efaecdf8e6c7a27 /add-service
parente5b5714cf652c747f2121656139cc1972c677375 (diff)
downloadrpm-helper-751f55f6a09a18bcb6ffab577256d93824ee29cc.tar
rpm-helper-751f55f6a09a18bcb6ffab577256d93824ee29cc.tar.gz
rpm-helper-751f55f6a09a18bcb6ffab577256d93824ee29cc.tar.bz2
rpm-helper-751f55f6a09a18bcb6ffab577256d93824ee29cc.tar.xz
rpm-helper-751f55f6a09a18bcb6ffab577256d93824ee29cc.zip
Remove a split out function which no longer reflected it's name.
The function is short enough that splitting it out does not really aid readability
Diffstat (limited to 'add-service')
-rwxr-xr-xadd-service45
1 files changed, 21 insertions, 24 deletions
diff --git a/add-service b/add-service
index 654f7c9..4561f12 100755
--- a/add-service
+++ b/add-service
@@ -41,29 +41,6 @@ if [ -z "$units" ]; then
units="$srv.service"
fi
-add_chkconfig_service() {
- if [ -n "$units_to_enable" ]; then
- /bin/systemctl --quiet enable $units_to_enable
- fi
- if [ -n "$srv" ]; then
- /sbin/chkconfig --add $srv
-
- 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
- fi
- fi
- fi
-}
-
add_service() {
# Add the service
if [ -r /etc/sysconfig/msec ]; then
@@ -103,7 +80,27 @@ add_service() {
units_to_enable="$units"
fi
- add_chkconfig_service
+ # Actually do enable/disable foo
+ if [ -n "$units_to_enable" ]; then
+ /bin/systemctl --quiet enable $units_to_enable
+ fi
+ if [ -n "$srv" ]; then
+ /sbin/chkconfig --add $srv
+
+ 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
+ fi
+ fi
+ fi
}
if [ $num = 1 ]; then