Slight modifications on main script
This commit is contained in:
parent
5687980764
commit
e7a2d8c996
5 changed files with 36 additions and 15 deletions
|
|
@ -3,8 +3,8 @@ Section: custom
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Maintainer: Jonathan Sélea <jonathan@selea.se>
|
Maintainer: Jonathan Sélea <jonathan@selea.se>
|
||||||
Package: lp-ddns
|
Package: lp-ddns
|
||||||
Version: 0.1b
|
Version: 0.1c
|
||||||
Standard-Version: 0.1b
|
Standard-Version: 0.1c
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Essential: no
|
Essential: no
|
||||||
Depends-On: curl
|
Depends-On: curl
|
||||||
|
|
|
||||||
34
lp-ddns/DEBIAN/copyright
Normal file
34
lp-ddns/DEBIAN/copyright
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
Files: *
|
||||||
|
Copyright: 2019 Jonathan Sélea
|
||||||
|
License: GPL-2+
|
||||||
|
|
||||||
|
Files: debian/*
|
||||||
|
Copyright: 1998-2010 Josip Rodin <joy-mg@debian.org>
|
||||||
|
License: GPL-2+
|
||||||
|
|
||||||
|
Files: /etc/lp-ddns/*
|
||||||
|
Copyright: 2019 Jonathan Sélea
|
||||||
|
License: GPL-2+
|
||||||
|
|
||||||
|
Files: /usr/local/bin/lp-ddns
|
||||||
|
Copyright: 2019 Jonathan Sélea
|
||||||
|
License: GPL-2+
|
||||||
|
|
||||||
|
License: GPL-2+
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
.
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
.
|
||||||
|
You should have received a copy of the GNU General Public License along
|
||||||
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
.
|
||||||
|
On Debian systems, the full text of the GNU General Public
|
||||||
|
License version 2 can be found in the file
|
||||||
|
'/usr/share/common-licenses/GPL-2'.
|
||||||
|
|
@ -1,14 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
. /etc/lp-dyndns/settings.conf
|
. /etc/lp-dyndns/settings.conf
|
||||||
|
|
||||||
#RECORDID="11111"
|
|
||||||
#PASSWORD="passss"
|
|
||||||
#DOMAIN="sub.domain.tld"
|
|
||||||
|
|
||||||
|
|
||||||
# DO NOT MODIFY #
|
|
||||||
IP="$(curl --connect-timeout 10 -s ipv4.is || curl --connect-timeout 10 -s ipv4.is)"
|
IP="$(curl --connect-timeout 10 -s ipv4.is || curl --connect-timeout 10 -s ipv4.is)"
|
||||||
#IP="$(curl --config /etc/lp-dyndns/curlrc)"
|
#IP="$(curl --config /etc/lp-dyndns/curlrc)"
|
||||||
CURRENTIP="$(dig ${DOMAIN} +short)"
|
CURRENTIP="$(dig ${DOMAIN} +short)"
|
||||||
|
|
@ -22,10 +14,7 @@ CYAN='\033[0;36m'
|
||||||
LCYAN='\033[0;37m'
|
LCYAN='\033[0;37m'
|
||||||
YELLOW='\033[1;33m'
|
YELLOW='\033[1;33m'
|
||||||
# END
|
# END
|
||||||
|
|
||||||
|
|
||||||
echo -e "The current external IP is ${YELLOW}${IP}${NC}"
|
echo -e "The current external IP is ${YELLOW}${IP}${NC}"
|
||||||
|
|
||||||
if [ "${IP}" == "${CURRENTIP}" ];
|
if [ "${IP}" == "${CURRENTIP}" ];
|
||||||
then
|
then
|
||||||
echo -e "${GREEN}The current IP matches the record ${DOMAIN}, no need to update.${NC}"
|
echo -e "${GREEN}The current IP matches the record ${DOMAIN}, no need to update.${NC}"
|
||||||
|
|
@ -33,6 +22,4 @@ else
|
||||||
echo -e "${RED}Current IP does not match the record ${CURRENTIP} updating...${NC}"
|
echo -e "${RED}Current IP does not match the record ${CURRENTIP} updating...${NC}"
|
||||||
curl ${APIURL}
|
curl ${APIURL}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
||||||
BIN
lp-ddns_0.1a.deb
BIN
lp-ddns_0.1a.deb
Binary file not shown.
BIN
lp-ddns_0.1c.deb
Normal file
BIN
lp-ddns_0.1c.deb
Normal file
Binary file not shown.
Loading…
Reference in a new issue