From 5687980764794eed0518f1af2cf91a31b0bd53c3 Mon Sep 17 00:00:00 2001 From: jonathan Date: Fri, 13 Dec 2019 15:21:53 +0000 Subject: [PATCH] Remove logger, added cronjob every 30 minutes --- lp-ddns/DEBIAN/conffiles | 1 + lp-ddns/DEBIAN/control | 4 ++-- lp-ddns/etc/cron.d/lp-ddns | 1 + lp-ddns/usr/local/bin/lp-ddns | 6 +++--- lp-ddns.deb => lp-ddns_0.1a.deb | Bin 5 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 lp-ddns/etc/cron.d/lp-ddns rename lp-ddns.deb => lp-ddns_0.1a.deb (100%) diff --git a/lp-ddns/DEBIAN/conffiles b/lp-ddns/DEBIAN/conffiles index fdb23e6..f0b65ca 100644 --- a/lp-ddns/DEBIAN/conffiles +++ b/lp-ddns/DEBIAN/conffiles @@ -1 +1,2 @@ /etc/lp-dyndns/settings.conf +/etc/cron.d/lp-ddns diff --git a/lp-ddns/DEBIAN/control b/lp-ddns/DEBIAN/control index b489553..4090fe0 100644 --- a/lp-ddns/DEBIAN/control +++ b/lp-ddns/DEBIAN/control @@ -3,8 +3,8 @@ Section: custom Priority: optional Maintainer: Jonathan Sélea Package: lp-ddns -Version: 0.1a -Standard-Version: 0.1a +Version: 0.1b +Standard-Version: 0.1b Architecture: all Essential: no Depends-On: curl diff --git a/lp-ddns/etc/cron.d/lp-ddns b/lp-ddns/etc/cron.d/lp-ddns new file mode 100644 index 0000000..ef04be0 --- /dev/null +++ b/lp-ddns/etc/cron.d/lp-ddns @@ -0,0 +1 @@ +*/30 * * * * lp-ddns >/dev/null 2>&1 diff --git a/lp-ddns/usr/local/bin/lp-ddns b/lp-ddns/usr/local/bin/lp-ddns index b9dcacb..da4eef3 100755 --- a/lp-ddns/usr/local/bin/lp-ddns +++ b/lp-ddns/usr/local/bin/lp-ddns @@ -24,13 +24,13 @@ YELLOW='\033[1;33m' # END -echo -e "The current external IP is ${YELLOW}${IP}${NC}" | logger +echo -e "The current external IP is ${YELLOW}${IP}${NC}" if [ "${IP}" == "${CURRENTIP}" ]; then - echo -e "${GREEN}The current IP matches the record ${DOMAIN}, no need to update.${NC}" | logger + echo -e "${GREEN}The current IP matches the record ${DOMAIN}, no need to update.${NC}" else - echo -e "${RED}Current IP does not match the record ${CURRENTIP} updating...${NC}" | logger + echo -e "${RED}Current IP does not match the record ${CURRENTIP} updating...${NC}" curl ${APIURL} fi diff --git a/lp-ddns.deb b/lp-ddns_0.1a.deb similarity index 100% rename from lp-ddns.deb rename to lp-ddns_0.1a.deb