Skip to content

Commit

Permalink
dns_njalla: fix record_id grep when removing record
Browse files Browse the repository at this point in the history
Before remove-record would fail with
response='{"error": {"code": -32000, "message": "Invalid arguments"}, "jsonrpc": "2.0"}'
because record_id would always be empty.

Signed-off-by: Alfred Persson Forsberg <[email protected]>
  • Loading branch information
alfredfo committed Apr 29, 2024
1 parent 8c07af6 commit b93e2c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dnsapi/dns_njalla.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ dns_njalla_rm() {
echo "$records" | while read -r record; do
record_name=$(echo "$record" | _egrep_o "\"name\":\s?\"[^\"]*\"" | cut -d : -f 2 | tr -d " " | tr -d \")
record_content=$(echo "$record" | _egrep_o "\"content\":\s?\"[^\"]*\"" | cut -d : -f 2 | tr -d " " | tr -d \")
record_id=$(echo "$record" | _egrep_o "\"id\":\s?[0-9]+" | cut -d : -f 2 | tr -d " " | tr -d \")
record_id=$(echo "$record" | _egrep_o "\"id\":\s?\"[^\"]*\"" | cut -d : -f 2 | tr -d " " | tr -d \")
if [ "$_sub_domain" = "$record_name" ]; then
if [ "$txtvalue" = "$record_content" ]; then
_debug "record_id" "$record_id"
Expand Down

0 comments on commit b93e2c9

Please sign in to comment.