extranet/batch/Makefile
Sebastien BEAUGRAND 4d1b2b63e7 80 colonnes
2010-11-29 10:26:18 +00:00

49 lines
1.4 KiB
Makefile

# ---------------------------------------------------------------------------- #
# Makefile d'installation des batch
# ---------------------------------------------------------------------------- #
include config.mk
.SUFFIXES:
.PHONY: all
all:
@echo
@echo "make cron-giant"
@echo " -> executer giant.php tous les jours"
@echo
crontab = \
crontab -l > $@ ;\
echo "MAILTO=$(MEL_TO)" >> $@ ;\
echo "$(1) * * * cd `pwd` && $(2)" >> $@ ;\
vi $@ ;\
crontab $@ ;\
rm -f $@ $@~ ;\
crontab -l ;\
echo
.PHONY: cron-giant
cron-giant: test-services-linux
@$(call crontab,20 13,php giant.php)
.PHONY: test-services-linux
test-services-linux:
@echo
$(if $(shell /sbin/service crond status | grep pid), , \
@echo -e "# TODO: 'sudo chkconfig crond on ; \
sudo service crond start'\n")
$(if $(shell /sbin/service sendmail status | grep pid), , \
@echo -e "# TODO: 'sudo chkconfig sendmail on ; \
sudo service sendmail start'\n")
$(if $(shell grep root /etc/mail/genericstable), , \
@echo -e "# Exemple de configuration de sendmail :\n\
urpmi sendmail-cf\n\
Dans /etc/hosts : 127.0.0.1 localhost.localdomain localhost\n\
Dans /etc/mail/sendmail.mc :\n\
FEATURE(genericstable)\n\
FEATURE(masquerade_envelope)\n\
GENERICS_DOMAIN(localhost.localdomain)\n\
Dans /etc/mail/genericstable : root $(MEL_FROM)\n\
cd /etc/mail ; make\n\
service sendmail restart\n")