diff options
-rwxr-xr-x | add-service | 45 |
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 |