diff options
Diffstat (limited to 'del-service')
-rwxr-xr-x | del-service | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/del-service b/del-service index 096d717..881bb99 100755 --- a/del-service +++ b/del-service @@ -20,18 +20,26 @@ num=$2 # number of packages installed srv=$3 # name of the service systemd=no +sysv=no +options=--quiet + [ -x /bin/systemctl -a -r /lib/systemd/system/${srv}.service ] && systemd=yes +[ -r /etc/rc.d/init.d/${srv} ] && sysv=yes +[ $sysv = yes ] && options="$options --no-reload" if [ $num = 0 ]; then + # Will be redirected to systemd if needed if [ -z "$DURING_INSTALL" ]; then /sbin/service $srv stop > /dev/null || : fi # support for systemd. chkconfig will do daemon-reload for us if [ $systemd = yes ]; then - /bin/systemctl --quiet --no-reload disable ${srv}.service + /bin/systemctl $options disable ${srv}.service + fi + if [ $sysv = yes ]; then + /sbin/chkconfig --del $srv fi - /sbin/chkconfig --del $srv fi # del-service ends here |