-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdnsfwd.sh
More file actions
26 lines (25 loc) · 682 Bytes
/
Copy pathdnsfwd.sh
File metadata and controls
26 lines (25 loc) · 682 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
#cli53 wrapper to redirect sites on aws
#
# ./dnsfwd <subdomain> <destination>
#
if [ -z $1 ]; then
echo "usage: ./dnsfwd <domainToFwd> <optional destination> - defaults to www.defaultdestinationURL.com"
exit
else
domainToFwd=$1
if [ -z $2 ]; then
destDomain="www.defaultdestinationURL.com"
else
destDomain=$2
fi
fi
cmd1="cli53 rrcreate --replace --wait $domainToFwd '@ 60 A 45.55.72.95'"
echo $cmd1
eval $cmd1
cmd2="cli53 rrcreate --wait $domainToFwd '_redirect TXT \"Redirects to https://$destDomain\"'"
echo $cmd2
eval $cmd2
cmd3="cli53 rrcreate --wait $domainToFwd '_redirect.www TXT \"Redirects to https://$destDomain\"'"
echo $cmd3
eval $cmd3