UPnP_Router/Makefile
2025-08-10 18:28:53 +01:00

21 lines
543 B
Makefile

SHELL := /bin/bash
# Use Make's built-in current directory variable
CURDIR := $(abspath .)
NEW_CRON := 0 3 * * * $(CURDIR)/main.sh
.PHONY: run-script install requirements
run-script:
# Run the main script
./main.sh
install:
# Add entry in crontab if missing (no duplicates)
@crontab -l 2>/dev/null | grep -Fqx '$(NEW_CRON)' && \
echo "Cron already exists." || \
{ (crontab -l 2>/dev/null; echo '$(NEW_CRON)') | crontab -; echo "Cron installed."; }
requirements:
# Add the necessary packages
apt-get -y install make miniupnpc gawk