../pdns/pdnssec --config-dir=. --config-name=remote secure-zone example.com
../pdns/pdnssec --config-dir=. --config-name=remote secure-zone up.example.com
- ./feed_ds.pl up.example.com example.com "../pdns/pdnssec --config-dir=. --config-name=remote" $testsdir/remote.sqlite3
+ ./gsql_feed_ds.pl up.example.com example.com "../pdns/pdnssec --config-dir=. --config-name=remote" "sqlite3 $testsdir/remote.sqlite3"
if [ "$remotesec" = "nsec3" ]
then
use warnings;
use 5.005;
-# usage: feed_ds.pl domain parent pdnssec sqdb
+# usage: feed_ds.pl domain parent pdnssec sqlcmd
my $domain = shift;
my $parent = shift;
my $pdnssec = shift;
-my $sqdb = shift;
+my $sqlcmd = shift;
+
+die "Usage: $0 domain parent pdnssec sqlcmd" unless($domain and $parent and $pdnssec and $sqlcmd);
open IN, "-|", "$pdnssec show-zone $domain 2>&1";
while(<IN>) {
chomp;
- if (/DS = (.*) IN DS (.*);/) {
+ if (/DS = (.*) IN DS (.*) ;/) {
# we have data
push @$recs, [ $1, $2 ]
for my $rec (@$recs) {
my ($name,$value) = @$rec;
- my $sql = qq(INSERT INTO records (domain_id, name, type, content, ttl, auth) SELECT id, "$name", "DS", "$value", 120, 1 FROM domains WHERE name = "$parent");
+ my $sql = qq(INSERT INTO records (domain_id, name, type, content, ttl, auth) SELECT id, '$name', 'DS', '$value', 120, 1 FROM domains WHERE name = '$parent');
# then feed data
- qx(sqlite3 $sqdb '$sql')
+ qx($sqlcmd "$sql")
}