diff options
-rw-r--r-- | Makefile | 18 |
1 files changed, 8 insertions, 10 deletions
@@ -2,24 +2,21 @@ prefix = /opt/Gitlab_Auto_Deploy/ -init_version := $(shell init --version 2>&1) -test_upstart := $(shell printf $(init_version) | grep upstart | wc -l) -test_systemd := $(shell printf $(init_version) | grep systemd | wc -l) -test_initv := $(shell printf $(init_version) | grep invalid | wc -l) +init_version := $(shell /sbin/init --version 2>&1) +test_upstart := $(shell printf $(init_version) | grep -q upstart || grep -q upstart /proc/net/unix ; echo $$?) +test_systemd := $(shell printf $(init_version) | grep -q systemd || grep -q systemd /proc/1/comm || grep -q systemd /proc/net/unix ; echo $$?) all: clean: initsystem: -ifeq ($(test_upstart),1) +ifeq ($(test_upstart),0) @echo "Upstart detected!" -else ifeq ($(test_systemd),1) +else ifeq ($(test_systemd),0) @echo "Systemd detected!" -else ifeq ($(test_initv),1) - @echo "InitV detected!" else - @echo "Error. Can't detect init system!" + @echo "InitV supposed" endif @echo "Done!" @@ -29,6 +26,7 @@ install: clean all @sudo cp GitAutoDeploy.conf.json.example $(prefix)GitAutoDeploy.conf.json @sudo cp GitAutoDeploy.py $(prefix) @sudo chmod +x $(prefix)GitAutoDeploy.py - + @echo "Installing run-on-startup scripts according to your init system ..." @make --silent initsystem + |