summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2020-05-28 14:01:03 -0400
committerAndrew Cady <d@jerkface.net>2020-05-28 14:01:03 -0400
commitf1cb71db11b0b83dc38b98d9117a284e6f3f5e47 (patch)
tree1a55cfee66d84145f4abb2887bf0fa5ce84197ad
parent41a6e23db90d9ee160b9e108220c81af640cc03f (diff)
better error reporting
-rwxr-xr-xsrc/dyndns-command.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/dyndns-command.sh b/src/dyndns-command.sh
index 8530058..375d50b 100755
--- a/src/dyndns-command.sh
+++ b/src/dyndns-command.sh
@@ -14,7 +14,15 @@ powerdns_sqlite_add_replace_record()
14 local sql_domain="$(sql_string "$3")" 14 local sql_domain="$(sql_string "$3")"
15 local record_type="$(sql_string "$4")" 15 local record_type="$(sql_string "$4")"
16 16
17 sqlite3 /etc/powerdns/powerdns.sqlite3 <<END 17 DBDIR=/etc/powerdns
18 DBNAME=powerdns.sqlite3
19 DB=$DBDIR/$DBNAME
20
21 test -r $DB && test -w $DB || die "Wrong permissions on $DB"
22 test -r $DBDIR && test -w $DBDIR || die "Wrong permissions on $DBDIR"
23
24 sqlite3 $DB <<END
25${SQL_ECHO:+.echo on}
18BEGIN; 26BEGIN;
19 DELETE FROM records WHERE type=$record_type AND name=$sql_new_domain; 27 DELETE FROM records WHERE type=$record_type AND name=$sql_new_domain;
20 28