From 601cb5987fe81d489ba4c1bafd96be123f3e7053 Mon Sep 17 00:00:00 2001 From: Greg Frost Date: Mon, 19 Oct 2009 23:11:34 +1030 Subject: ddclient LinHES-config runit-scripts: add dyndns support --- abs/core-testing/LinHES-config/PKGBUILD | 3 +- abs/core-testing/LinHES-config/mv_ddns.py | 25 ++++ abs/core-testing/LinHES-config/systemconfig.py | 3 +- abs/core-testing/runit-scripts/PKGBUILD | 2 +- .../runitscripts/services/ddclient/run | 8 + abs/extra-testing/ddclient/ChangeLog | 22 --- abs/extra-testing/ddclient/PKGBUILD | 30 ++-- .../ddclient/ddclient-foreground.patch | 47 ++++++ abs/extra-testing/ddclient/ddclient.conf.d | 2 - .../ddclient/ddclient.conf.dynamic.dyndns.sample | 162 +++++++++++++++++++++ abs/extra-testing/ddclient/ddclient.install | 41 ------ abs/extra-testing/ddclient/ddclient.rc | 37 ----- 12 files changed, 261 insertions(+), 121 deletions(-) create mode 100755 abs/core-testing/LinHES-config/mv_ddns.py create mode 100755 abs/core-testing/runit-scripts/runitscripts/services/ddclient/run delete mode 100644 abs/extra-testing/ddclient/ChangeLog create mode 100644 abs/extra-testing/ddclient/ddclient-foreground.patch delete mode 100644 abs/extra-testing/ddclient/ddclient.conf.d create mode 100644 abs/extra-testing/ddclient/ddclient.conf.dynamic.dyndns.sample delete mode 100644 abs/extra-testing/ddclient/ddclient.install delete mode 100644 abs/extra-testing/ddclient/ddclient.rc diff --git a/abs/core-testing/LinHES-config/PKGBUILD b/abs/core-testing/LinHES-config/PKGBUILD index 1e61fdf..cb8f8f3 100644 --- a/abs/core-testing/LinHES-config/PKGBUILD +++ b/abs/core-testing/LinHES-config/PKGBUILD @@ -1,6 +1,6 @@ pkgname=LinHES-config pkgver=2.1 -pkgrel=1 +pkgrel=2 conflicts=(MythVantage-config MythVantage-config-dev LinHES-config-dev ) pkgdesc="Install and configure your system" depends=(bc libstatgrab mysql-python expect curl dnsutils parted @@ -33,6 +33,7 @@ source=(mv_install.py README mv_advanced.py mv_common.py + mv_ddns.py mv_ir.py mv_misc.py mv_network.py diff --git a/abs/core-testing/LinHES-config/mv_ddns.py b/abs/core-testing/LinHES-config/mv_ddns.py new file mode 100755 index 0000000..8c05fbe --- /dev/null +++ b/abs/core-testing/LinHES-config/mv_ddns.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +import logging, mv_common +import os, re + +config_file = "mv_config" + +def setup_ddns(systemconfig): + logging.info("____Start of setup_ddns____") + + if systemconfig["DDnsEnable"] == "1": + logging.debug(" Enabling DDNS") + mv_common.cp_and_log("/etc/ddclient/ddclient.conf.dynamic.dyndns.sample", + "/etc/ddclient/ddclient.conf") + cmd = ''' sed -i -e "s/your-dynamic-dyndns-login/%s/g" /etc/ddclient/ddclient.conf''' %(systemconfig["DDnslogin"]) + mv_common.runcmd(cmd) + cmd = ''' sed -i -e "s/your-dynamic-dyndns-password/%s/g" /etc/ddclient/ddclient.conf''' %(systemconfig["DDnspassword"]) + mv_common.runcmd(cmd) + cmd = ''' sed -i -e "s/your-dynamic-dyndns-host/%s/g" /etc/ddclient/ddclient.conf''' %(systemconfig["DDnshostname"]) + mv_common.runcmd(cmd) + mv_common.add_service("ddclient") + else: + logging.debug(" Disabling DDNS") + mv_common.remove_service("ddclient") + + logging.info("__End of ddns\n") diff --git a/abs/core-testing/LinHES-config/systemconfig.py b/abs/core-testing/LinHES-config/systemconfig.py index c559e09..28e2e7a 100755 --- a/abs/core-testing/LinHES-config/systemconfig.py +++ b/abs/core-testing/LinHES-config/systemconfig.py @@ -147,7 +147,8 @@ def main(argv): mv_webuser.setup_web_auth(systemconfig["UseMythWEB_auth"]) if cmdmodule["ddns"]: - print " LOOK FOR DDNS" + import mv_ddns + mv_ddns.setup_ddns(systemconfig) if cmdmodule["screensaver"]: import mv_screensaver diff --git a/abs/core-testing/runit-scripts/PKGBUILD b/abs/core-testing/runit-scripts/PKGBUILD index 14297fd..3407502 100755 --- a/abs/core-testing/runit-scripts/PKGBUILD +++ b/abs/core-testing/runit-scripts/PKGBUILD @@ -1,6 +1,6 @@ pkgname=runit-scripts pkgver=1.8.0 -pkgrel=96 +pkgrel=97 pkgdesc="collection of startup scripts for runit" url="http://smarden.org/runit/" license="BSD" diff --git a/abs/core-testing/runit-scripts/runitscripts/services/ddclient/run b/abs/core-testing/runit-scripts/runitscripts/services/ddclient/run new file mode 100755 index 0000000..c5488f6 --- /dev/null +++ b/abs/core-testing/runit-scripts/runitscripts/services/ddclient/run @@ -0,0 +1,8 @@ +#!/bin/sh +export TERM=linux +. /etc/rc.conf +. /etc/rc.d/functions +stat_runit "Starting ddclient" + + +exec /usr/sbin/ddclient -foreground &> /var/log/ddclient.log diff --git a/abs/extra-testing/ddclient/ChangeLog b/abs/extra-testing/ddclient/ChangeLog deleted file mode 100644 index 4520b69..0000000 --- a/abs/extra-testing/ddclient/ChangeLog +++ /dev/null @@ -1,22 +0,0 @@ -2008-08-07 Abhishek Dasgupta - - * ddclient 3.7.3-2 - * added /etc/conf.d/ddclient for modifying - daemon poll frequency. This overrides the - setting specified in /etc/ddclient/ddclient.conf - when ddclient is called as an rc script. - -2007-08-08 Alessio 'mOLOk' Bolognino - - * ddclient-3.7.3-1 - * version bump - * GPL -> GPL2 - * shortened pkgdesc - -2007-07-02 tardo - - * Built for x86_64 - -2007-06-29 Georg Grabler (STiAT) - - * Version Bump to 3.7.2 diff --git a/abs/extra-testing/ddclient/PKGBUILD b/abs/extra-testing/ddclient/PKGBUILD index 121d2c5..f283cb9 100644 --- a/abs/extra-testing/ddclient/PKGBUILD +++ b/abs/extra-testing/ddclient/PKGBUILD @@ -3,33 +3,31 @@ # Contributor: David Rosenstrauch pkgname=ddclient -pkgver=3.7.3 -pkgrel=2 +pkgver=3.8.0 +pkgrel=1 pkgdesc="Update dynamic DNS entries for accounts on many dynamic DNS services." arch=('i686' 'x86_64') url="http://ddclient.sourceforge.net/" license=('GPL2') depends=('perl' 'perl-io-socket-ssl') -backup=('etc/ddclient/ddclient.conf' 'etc/conf.d/ddclient') -install=ddclient.install -source=(http://downloads.sourceforge.net/sourceforge/ddclient/ddclient-$pkgver.tar.bz2 ddclient.rc ddclient.conf.d) +backup=('etc/ddclient.conf') +source=(http://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.bz2 + ddclient.conf.dynamic.dyndns.sample + ddclient-foreground.patch) build() { - cd ${srcdir}/ddclient-${pkgver} + cd ${srcdir}/$pkgname-${pkgver} + patch < ${srcdir}/ddclient-foreground.patch # core files install -D -m755 ddclient ${pkgdir}/usr/sbin/ddclient - install -D -m755 ${srcdir}/ddclient.rc ${pkgdir}/etc/rc.d/ddclient - install -D -m600 sample-etc_ddclient.conf ${pkgdir}/etc/ddclient/ddclient.conf - install -D -m644 ${srcdir}/ddclient.conf.d ${pkgdir}/etc/conf.d/ddclient + install -D -m600 sample-etc_ddclient.conf ${pkgdir}/etc/ddclient/ddclient.conf.sample + install -D -m600 ${srcdir}/ddclient.conf.dynamic.dyndns.sample ${pkgdir}/etc/ddclient/ install -d ${pkgdir}/var/cache/ddclient # additional instructions, sample configs - install -D -m644 README ${pkgdir}/etc/ddclient/samples/README - install -D -m644 sample-etc_cron.d_ddclient ${pkgdir}/etc/ddclient/samples/sample-etc_cron.d_ddclient - install -D -m644 sample-etc_dhcpc_dhcpcd-eth0.exe ${pkgdir}/etc/ddclient/samples/sample-etc_dhcpc_dhcpcd-eth0.exe - install -D -m644 sample-etc_ppp_ip-up.local ${pkgdir}/etc/ddclient/samples/sample-etc_ppp_ip-up.local + install -D -m644 README ${pkgdir}/etc/ddclient/README } -md5sums=('f6a55bc68cf73ffe7e80d2fa5cd44f85' - '7035bf8132f3517a59167f61ee5e8b90' - 'b8f39c82827776da948b76ef83544d33') +md5sums=('6cac7a5eb1da781bfd4d98cef0b21f8e' + '4194825b9b4a7fcc1c57c2f5a4f6162b' + 'd8ffc95f98f9afcb4a06a1e192220e35') diff --git a/abs/extra-testing/ddclient/ddclient-foreground.patch b/abs/extra-testing/ddclient/ddclient-foreground.patch new file mode 100644 index 0000000..a814ede --- /dev/null +++ b/abs/extra-testing/ddclient/ddclient-foreground.patch @@ -0,0 +1,47 @@ +--- ../ddclient-orig/ddclient 2009-10-19 22:45:15.000000000 +1030 ++++ ddclient 2009-10-19 22:50:11.000000000 +1030 +@@ -307,6 +307,7 @@ + my %variables = ( + 'global-defaults' => { + 'daemon' => setv(T_DELAY, 0, 0, 1, 0, interval('60s')), ++ 'foreground' => setv(T_BOOL, 0, 0, 1, 0, undef), + 'file' => setv(T_FILE, 0, 0, 1, "$etc$program.conf", undef), + 'cache' => setv(T_FILE, 0, 0, 1, "$cachedir$program.cache", undef), + 'pid' => setv(T_FILE, 0, 0, 1, "", undef), +@@ -535,6 +536,7 @@ + "usage: ${program} [options]", + "options are:", + [ "daemon", "=s", "-daemon delay : run as a daemon, specify delay as an interval." ], ++ [ "foreground", "!", "-foreground : do not fork" ], + [ "proxy", "=s", "-proxy host : use 'host' as the HTTP proxy" ], + [ "server", "=s", "-server host : update DNS information on 'host'" ], + [ "protocol", "=s", "-protocol type : update protocol used" ], +@@ -623,7 +625,10 @@ + $SIG{'HUP'} = sub { $caught_hup = 1; }; + $SIG{'TERM'} = sub { $caught_term = 1; }; + $SIG{'KILL'} = sub { $caught_kill = 1; }; +-if (opt('daemon') && !opt('force')) { ++# don't fork() if foreground or force is on ++if (opt('foreground') || opt('force')) { ++ ; ++} elsif (opt('daemon')) { + $SIG{'CHLD'} = 'IGNORE'; + my $pid = fork; + if ($pid < 0) { +@@ -633,12 +638,15 @@ + exit 0; + } + $SIG{'CHLD'} = 'DEFAULT'; +- $opt{'syslog'} = 1; + open(STDOUT, ">/dev/null"); + open(STDERR, ">/dev/null"); + open(STDIN, "/dev/null - if [ $? -gt 0 ]; then - stat_fail - else - rm_daemon ddclient - stat_done - fi - ;; - restart) - $0 stop - sleep 1 - $0 start - ;; - *) - echo "usage: $0 {start|stop|restart}" -esac -- cgit v0.12