aboutsummaryrefslogtreecommitdiff
path: root/src/data/proto-test/txtrec-set.sh
diff options
context:
space:
mode:
authorDavid Timber <mieabby@gmail.com>2020-11-01 16:42:59 +1030
committerDavid Timber <mieabby@gmail.com>2020-11-01 16:42:59 +1030
commit60308ca4d9a5976a06aa8fe78a7b21951f9f206d (patch)
treefe0e95f49e58f991c5e3c6e973e5fafacf24fc7f /src/data/proto-test/txtrec-set.sh
parent3fb3d74e7113e514819670ee42e7f5703f13ceec (diff)
Add txtrec-del.sh, rename proto-test -> proto
Diffstat (limited to 'src/data/proto-test/txtrec-set.sh')
-rwxr-xr-xsrc/data/proto-test/txtrec-set.sh61
1 files changed, 0 insertions, 61 deletions
diff --git a/src/data/proto-test/txtrec-set.sh b/src/data/proto-test/txtrec-set.sh
deleted file mode 100755
index 50bb07d..0000000
--- a/src/data/proto-test/txtrec-set.sh
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/bash
-set -e
-
-ARR_HOOKS="
- aws
-"
-
-if [ $# -lt 2 ]; then
- echo "Usage: $0 <head rec> <hook> <zone id> [TTL]
-Hooks:" >&2
- for h in $ARR_HOOKS; do
- echo -e "\t$h"
- done
-
- exit 2
-fi
-
-HEAD_REC="$1"
-HOOK="$2"
-ZONE_ID="$3"
-if [ -z "$4" ]; then
- TTL=3600
-else
- TTL="$4"
-fi
-
-aws_param () {
- cat << EOF
-{
- "Changes": [
- {
- "Action": "UPSERT",
- "ResourceRecordSet": {
- "Name": "$1",
- "Type": "TXT",
- "TTL": $TTL,
- "ResourceRecords": [
- { "Value": "\"$2\"" }
- ]
- }
- }
- ]
-}
-EOF
-}
-
-hook_aws () {
- aws route53 change-resource-record-sets\
- --hosted-zone-id "$ZONE_ID"\
- --change-batch "$(aws_param "$1" "$2")"
-}
-
-while read line; do
- if [ -z "$line" ]; then
- break;
- fi
- "hook_$HOOK" $line
-done
-
-read line
-"hook_$HOOK" "$HEAD_REC" "$line"