ETC_DIR = "/etc/dae"
INSTALL = install -c

install:
	@if [ ! -d $(ETC_DIR) ]; then \
		echo "Directory doesn't exist. Creating..."; \
		mkdir $(ETC_DIR); \
	else \
		echo "Directory exists"; \
	fi
	@if [ ! -f $(ETC_DIR)/dae.conf ]; then \
		echo "Copying config..."; \
		cp dae.conf $(ETC_DIR)/dae.conf; \
	else \
		echo "Config exists"; \
	fi	
	$(INSTALL) -m 0755 dae /usr/sbin/dae;
	$(INSTALL) -m 0755 dae.init /etc/init.d/dae;
	update-rc.d dae defaults 99;