From 694ca35d2787322db94b1a165a7cddd549a52d6a Mon Sep 17 00:00:00 2001 From: Justin Reichardt Date: Tue, 3 Aug 2021 13:51:07 -0500 Subject: [PATCH] Added systemd.path to update when a cfg is edited --- Makefile | 5 +++++ src/removeadhosts.path | 10 ++++++++++ 2 files changed, 15 insertions(+) create mode 100644 src/removeadhosts.path diff --git a/Makefile b/Makefile index 8136378..f82a454 100644 --- a/Makefile +++ b/Makefile @@ -8,12 +8,17 @@ install: dir chmod +x /usr/local/share/removeadhosts/removeadhosts.sh cp /usr/local/share/removeadhosts/removeadhosts.service /etc/systemd/system/ cp /usr/local/share/removeadhosts/removeadhosts.timer /etc/systemd/system/ + cp /usr/local/share/removeadhosts/removeadhosts.path /etc/systemd/system/ activate: install systemctl enable removeadhosts.timer systemctl start removeadhosts.timer + systemctl enable removeadhosts.path + systemctl start removeadhosts.path deactivate: systemctl disable removeadhosts.timer systemctl stop removeadhosts.timer + systemctl disable removeadhosts.path + systemctl stop removeadhosts.path remove: deactivate rm -f /etc/systemd/system/removeadhosts* rm -fr /usr/local/share/removeadhosts/ diff --git a/src/removeadhosts.path b/src/removeadhosts.path new file mode 100644 index 0000000..1de17ac --- /dev/null +++ b/src/removeadhosts.path @@ -0,0 +1,10 @@ +[Unit] +Description="Monitor the /etc/passwd file for changes" + +[Path] +PathModified=/etc/removeadhosts/adlist.txt +PathModified=/etc/removeadhosts/adlistings.txt +Unit=removeadhosts.service + +[Install] +WantedBy=multi-user.target