Compare commits

...

19 commits

Author SHA1 Message Date
182cf7ceff new .deb file 2021-07-02 10:59:26 +02:00
selea
7ca4805578
Merge pull request #1 from grondinm/master
Add option to specify remote NameServer to query
2021-02-16 19:44:56 +01:00
Marc Grondin
cf46b9d581 Add option to specify remote NameServer to query.
This helps in the case that the NameServer on the
system running lp-ddns uses a local NameServer and
resolves to local IP for the domain in question.

Signed-off-by: Marc Grondin <myself@marcg.pizza>
2020-10-14 21:22:46 -03:00
selea
36c916750d
Update lp-ddns
Acknownledge differences in how different distros use cron.d
2020-06-07 23:20:21 +02:00
selea
663bb318f3
Update control
Updates CONTROL
2020-06-07 18:53:19 +02:00
selea
e6576af281
Update lp-ddns
Fixed bad crontab
2020-06-07 18:50:58 +02:00
9e3dcc6833 Added .deb file for ease 2020-06-03 18:37:58 +02:00
selea
7b02709e4e
Update README.md 2020-05-14 19:04:36 +02:00
2efd607d21 Slight modifications 2020-05-14 18:48:28 +02:00
selea
ed8d1d1e42
Delete lp-ddns.deb 2020-05-14 18:37:47 +02:00
6f03ba3283 Slight modification 2020-05-14 17:27:28 +02:00
selea
0ab371e535
Update packagingscript.sh 2020-05-14 16:57:36 +02:00
64d1d3cd57 Packaging foundation 2020-05-14 16:52:47 +02:00
0205dfea65 Packaging+Repo modifications 2020-05-14 16:50:29 +02:00
2b38980d50 gbp.conf added 2020-01-04 23:06:00 +01:00
8084b862e9 Added recipe 2020-01-04 23:03:44 +01:00
2c9144ed5c Fixed some stuff 2020-01-04 22:53:07 +01:00
e7a2d8c996 Slight modifications on main script 2019-12-17 13:31:20 +00:00
5687980764 Remove logger, added cronjob every 30 minutes 2019-12-13 15:21:53 +00:00
13 changed files with 133 additions and 22 deletions

View file

@ -1,6 +1,6 @@
# lp-dyndns
This is the buildsource for the lp-dyndns package - mean for being distributed to users of FreeDNS.linux.pizza
[![Build Status](https://drone.selea.se/api/badges/jonathan/lp-dyndns/status.svg)](https://drone.selea.se/jonathan/lp-dyndns)
Feel free to fork and contribute

2
gbp.conf Normal file
View file

@ -0,0 +1,2 @@
[buildpackage]
debian-branch = debian/sid

Binary file not shown.

4
lp-ddns.recipe Normal file
View file

@ -0,0 +1,4 @@
# bzr-builder format 0.2 deb-version {debupstream}-0~{revno}
lp:lp-ddns
nest packaging lp:~jonathan-selea/lp-ddns/lp-ddns debian

View file

@ -1,5 +1,5 @@
PACKAGE (0.1a) UNRELEASED; urgency=medium
PACKAGE (0.2) UNRELEASED; urgency=medium
* 0.1a First working commit,
* 0.2 Make output prettier when executing "lp-ddns"
-- Jonathan Sélea <jonathan@selea.se> Sun, 08 Dec 2019 16:02:15 +0100
-- Jonathan Sélea <jonathan@selea.se> Sun, 4 Jan 2020 22:48:15 +0100

View file

@ -1 +1,2 @@
/etc/lp-dyndns/settings.conf
/etc/cron.d/lp-ddns

View file

@ -3,11 +3,11 @@ Section: custom
Priority: optional
Maintainer: Jonathan Sélea <jonathan@selea.se>
Package: lp-ddns
Version: 0.1a
Standard-Version: 0.1a
Version: 0.5
Standard-Version: 0.5
Architecture: all
Essential: no
Depends-On: curl
Depends-On: curl bash
Homepage: https://linux.pizza
Vcs-Git: https://git.selea.se/jonathan/lp-dyndns
Vcs-Git: https://github.com/wioxjk/lp-ddns/
Description: Tool for managing Dynamic DNS toghether with FreeDNS.linux.pizza

34
lp-ddns/DEBIAN/copyright Normal file
View 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'.

0
lp-ddns/DEBIAN/rules Executable file
View file

View file

@ -0,0 +1,6 @@
# Please modify this according to your needs.
# This crontab works on Debian, but certain distro may interpret this differently.
#@reboot /usr/local/bin/lp-ddns >/dev/null 2>&1
#*/30 * * * /usr/local/bin/lp-ddns >/dev/null 2>&1

View file

@ -2,10 +2,11 @@
# RECORDID="235890
# PASSWORD="verystrongpassword"
# DOMAIN="sub.domain.tld"
# NAMESERVER="NameServerToQuery"
RECORDID=""
PASSWORD=""
DOMAIN=""
NAMESERVER="" #Blank for system NameServer

View file

@ -1,17 +1,25 @@
#!/bin/bash
set -e
# Comment this if you want to use this script standalone:
. /etc/lp-dyndns/settings.conf
#RECORDID="11111"
#PASSWORD="passss"
#DOMAIN="sub.domain.tld"
# Uncomment if you want to use this script standalone:
#RECORDID=
#PASSWORD=
#DOMAIN=
# DO NOT MODIFY #
# Do not touch this, unless you want to touch this :)
IP="$(curl --connect-timeout 10 -s ipv4.is || curl --connect-timeout 10 -s ipv4.is)"
#IP="$(curl --config /etc/lp-dyndns/curlrc)"
CURRENTIP="$(dig ${DOMAIN} +short)"
if [ "${NAMESERVER}" = "" ];
then
CURRENTIP="$(dig ${DOMAIN} +short)"
else
CURRENTIP="$(dig @${NAMESERVER} ${DOMAIN} +short)"
fi
APIURL="https://freedns.linux.pizza/api/v1/remote/updatepw?record=${RECORDID}&password=${PASSWORD}&content=${IP}"
# Making stuff fancy
NC='\033[0m'
@ -22,17 +30,12 @@ CYAN='\033[0;36m'
LCYAN='\033[0;37m'
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
exit 0

60
packagingscript.sh Executable file
View file

@ -0,0 +1,60 @@
#!/usr/bin/env bash
# Based on scripts by azlux.fr
pkgname=lp-ddns
repo="wioxjk/lp-ddns"
current=$(reprepro -b /srv/repos/ list stable lp-ddns | head -n1 | awk '{print $3}')
if [[ ! -d /tmp/${pkgname} ]]; then
git clone https://github.com/$repo /tmp/lp-ddns
else
cd /tmp/${pkgname}
git fetch
tp=$(git pull)
fi
cd /tmp/${pkgname}
new=$(grep 'declare version=' ${pkgname} | cut -d '"' -f 2)
if [ "$current" == "$new" ]; then
exit
fi
echo "New LP-DDNS version $current -> $new"
STARTDIR="/tmp/${pkgname}/build"
DESTDIR="$STARTDIR/pkg"
OUTDIR="$STARTDIR/deb"
rm -rf "$STARTDIR"
mkdir "$STARTDIR"
install -Dm 755 "/tmp/${pkgname}/${pkgname}" "$DESTDIR/usr/local/bin/${pkgname}"
mkdir -p "$DESTDIR/DEBIAN"
cat >"$DESTDIR/DEBIAN/control"<<EOL
Source: lp-ddns
Section: custom
Priority: optional
Maintainer: Jonathan Sélea <jonathan@selea.se>
Package: ${pkgname}
Version: $new
Standard-Version: 0.2a
Architecture: all
Essential: no
Depends-On: curl bash
Homepage: https://linux.pizza
Vcs-Git: https://github.com/wioxjk/lp-ddns
Bugs: https://github.com/wioxjk/lp-ddns/issues
Description: Tool for managing Dynamic DNS toghether with FreeDNS.linux.pizza
EOL
mkdir "$OUTDIR"
dpkg-deb --build "$DESTDIR" "$OUTDIR"
reprepro -b /srv/repos includedeb buster "$OUTDIR"/*.deb
reprepro -b /srv/repos includedeb stretch "$OUTDIR"/*.deb
rm -rf "$STARTDIR"