summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO21
-rw-r--r--.gitignore6
-rw-r--r--PKGBUILD30
-rw-r--r--rbldnsd-sync.install20
-rw-r--r--rbldnsd-sync.opts6
-rw-r--r--rbldnsd-sync.service14
-rw-r--r--rbldnsd-sync.sh16
-rw-r--r--rbldnsd-sync.timer10
8 files changed, 123 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..6f05cf961b9
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,21 @@
+pkgbase = rbldnsd-sync
+ pkgdesc = Synchronization for RBLDNSD
+ pkgver = 1.0.0
+ pkgrel = 1
+ install = rbldnsd-sync.install
+ arch = x86_64
+ license = GPL
+ depends = rbldnsd
+ depends = rsync
+ backup = etc/conf.d/rbldnsd-sync
+ source = rbldnsd-sync.service
+ source = rbldnsd-sync.timer
+ source = rbldnsd-sync.sh
+ source = rbldnsd-sync.opts
+ sha256sums = 3536ec30d5b4d897c178d240608a55e9ee140630514523a9c4651bbb77c2916c
+ sha256sums = 69d23c6043d96b40f539b178d452f2753d602a68f3d5381b2c54cc142f70aad2
+ sha256sums = 5dee2c9126c87b06e1da5547b47d033ffcfa0165c5fd419322a7f249c5b82f9a
+ sha256sums = 502c62f50f600261f0b63c3707bf5fa5601faa807b4aa4d7a3410fd58eaa2b70
+
+pkgname = rbldnsd-sync
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000000..9dd777bf6f4
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+src/
+pkg/
+*.war
+*.tar.xz
+*.tar.gz
+*.log
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..0d9ddd85026
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,30 @@
+# Maintainer: pappy <pappy _AT_ a s c e l i o n _DOT_ com>
+
+pkgname=rbldnsd-sync
+pkgver=1.0.0
+pkgrel=1
+pkgdesc="Synchronization for RBLDNSD"
+arch=(x86_64)
+license=(GPL)
+source=($pkgname.service
+ $pkgname.timer
+ $pkgname.sh
+ $pkgname.opts
+ )
+depends=(rbldnsd rsync)
+install=$pkgname.install
+backup=(etc/conf.d/$pkgname)
+
+sha256sums=('3536ec30d5b4d897c178d240608a55e9ee140630514523a9c4651bbb77c2916c'
+ '69d23c6043d96b40f539b178d452f2753d602a68f3d5381b2c54cc142f70aad2'
+ '5dee2c9126c87b06e1da5547b47d033ffcfa0165c5fd419322a7f249c5b82f9a'
+ '502c62f50f600261f0b63c3707bf5fa5601faa807b4aa4d7a3410fd58eaa2b70')
+
+package()
+{
+ install -Dm644 $pkgname.opts $pkgdir/etc/conf.d/$pkgname
+ install -Dm755 $pkgname.sh $pkgdir/usr/bin/$pkgname
+ install -Dm644 $pkgname.service $pkgdir/usr/lib/systemd/system/$pkgname.service
+ install -Dm644 $pkgname.timer $pkgdir/usr/lib/systemd/system/$pkgname.timer
+}
+
diff --git a/rbldnsd-sync.install b/rbldnsd-sync.install
new file mode 100644
index 00000000000..4b60dd6b1eb
--- /dev/null
+++ b/rbldnsd-sync.install
@@ -0,0 +1,20 @@
+
+post_install()
+{
+ systemctl enable --now rbldnsd-sync.timer
+ echo ""
+ echo "Initialising DBLs"
+ echo ""
+ systemctl start rbldnsd-sync
+}
+
+post_upgrade()
+{
+ systemctl daemon-reload
+}
+
+pre_remove()
+{
+ systemctl disable --now rbldnsd-sync.timer
+}
+
diff --git a/rbldnsd-sync.opts b/rbldnsd-sync.opts
new file mode 100644
index 00000000000..879d7c971a2
--- /dev/null
+++ b/rbldnsd-sync.opts
@@ -0,0 +1,6 @@
+# Synchronizations, make sure rbldnsd is restarted after you modify and sync
+# the databases for the first time.
+RSYNC[ip4set]="psbl-mirror.surriel.com::psbl/psbl.txt
+ rsync.unsubscore.com::LBBL/ubl_rbldns.txt
+"
+
diff --git a/rbldnsd-sync.service b/rbldnsd-sync.service
new file mode 100644
index 00000000000..03026de318b
--- /dev/null
+++ b/rbldnsd-sync.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=RBLDNSD Synchronisation
+
+[Service]
+Group=rbldnsd
+Type=simple
+Nice=19
+ExecStart=/usr/bin/rbldnsd-sync
+StandardOutput=file:/var/rbldnsd/sync.log
+StandardError=inherit
+
+[Install]
+WantedBy=default.target
+
diff --git a/rbldnsd-sync.sh b/rbldnsd-sync.sh
new file mode 100644
index 00000000000..dc00304c103
--- /dev/null
+++ b/rbldnsd-sync.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+declare -A RSYNC
+source /etc/conf.d/rbldnsd-sync
+cd /var/rbldnsd
+
+umask 0027
+
+for type in ${!RSYNC[@]}; do
+ mkdir -p $type
+ for file in ${RSYNC[$type]}; do
+ base=${file##*/}
+ rsync -uzvt $file $type/$base
+ done
+done
+
diff --git a/rbldnsd-sync.timer b/rbldnsd-sync.timer
new file mode 100644
index 00000000000..d09769d433d
--- /dev/null
+++ b/rbldnsd-sync.timer
@@ -0,0 +1,10 @@
+[Unit]
+Description=RBLDNSD Synchronisation Timer
+
+[Timer]
+OnCalendar=hourly
+Persistent=true
+
+[Install]
+WantedBy=timers.target
+