From 751f55f6a09a18bcb6ffab577256d93824ee29cc Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Sun, 30 Oct 2011 14:47:55 +0000 Subject: 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 --- add-service | 45 +++++++++++++++++++++------------------------ 1 file 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 -- cgit v1.2.1