Makefile: add back support for non-systemd systems

This commit is contained in:
Jason M. Wood 2015-11-16 14:57:03 -07:00
parent 9a2d6af2f6
commit 8191fab5f2

View File

@ -3,6 +3,7 @@ MSCS_HOME := /opt/mscs
MSCTL := /usr/local/bin/msctl
MSCS := /usr/local/bin/mscs
MSCS_INIT_D := /etc/init.d/mscs
MSCS_SERVICE := /etc/systemd/system/mscs.service
MSCS_COMPLETION := /etc/bash_completion.d/mscs
@ -12,6 +13,9 @@ install: update
adduser --system --group --home $(MSCS_HOME) --quiet $(MSCS_USER)
if which systemctl; then \
systemctl -f enable mscs.service; \
else \
ln -s $(MSCS) $(MSCS_INIT_D); \
update-rc.d mscs defaults; \
fi
update:
@ -26,5 +30,8 @@ clean:
if which systemctl; then \
systemctl -f disable mscs.service; \
rm -f $(MSCS_SERVICE); \
else \
update-rc.d mscs remove; \
rm -f $(MSCS_INIT_D); \
fi
rm -f $(MSCTL) $(MSCS) $(MSCS_COMPLETION)