diff options
author | David Timber <mieabby@gmail.com> | 2021-08-09 21:54:10 +1000 |
---|---|---|
committer | David Timber <mieabby@gmail.com> | 2021-08-09 21:54:10 +1000 |
commit | c008231406e43f314a19a3d34c1218d06815dc8a (patch) | |
tree | 3b773cbd956d7f0e76dfb7f4ee52730d2f4fb1ab /src/data/proto/txtrec-set.sh | |
parent | eea0a9fbbf1aff1eac1f17914d5c116de98e1d93 (diff) |
Impl proone-htbtclient txtrec mode ...
* Relocate /src/data/proto/txtrec-*.sh to /src
Diffstat (limited to 'src/data/proto/txtrec-set.sh')
-rwxr-xr-x | src/data/proto/txtrec-set.sh | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/src/data/proto/txtrec-set.sh b/src/data/proto/txtrec-set.sh deleted file mode 100755 index 50bb07d..0000000 --- a/src/data/proto/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" |