MC conf update -- AWS DDNS
This commit is contained in:
parent
e552eb93ef
commit
fbd16211a0
34
AWS/DDNS.bash
Executable file
34
AWS/DDNS.bash
Executable file
@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
HOSTED_ZONE_ID="/hostedzone/Z00026583L98XLGPBWMM8"
|
||||
|
||||
rm -f change-resource-record-sets.json
|
||||
IFS='' read -r -d '' resource_update << EOS
|
||||
{
|
||||
"Comment": "Update record to reflect new IP address for a system ",
|
||||
"Changes": [
|
||||
{
|
||||
"Action": "UPSERT",
|
||||
"ResourceRecordSet": {
|
||||
"Name": "gitlab.orion-technologies.io",
|
||||
"Type": "A",
|
||||
"TTL": 300,
|
||||
"ResourceRecords": [
|
||||
{
|
||||
"Value": "$(wget -qO- https://ipecho.net/plain ; echo)"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
EOS
|
||||
|
||||
echo \
|
||||
"Issuing command:
|
||||
aws route53 change-resource-record-sets --hosted-zone-id ${HOSTED_ZONE_ID} --change-batch json-data-update(see script)"
|
||||
|
||||
result="$(aws route53 change-resource-record-sets --hosted-zone-id "${HOSTED_ZONE_ID}" --change-batch "${resource_update}")"
|
||||
echo \
|
||||
"Current Record Status:
|
||||
$(jq '.ChangeInfo.Status' <(echo "${result}"))"
|
@ -302,8 +302,11 @@ if [[ "${rcon_ignore}" == 0 ]]; then
|
||||
[[ -z "${DEFAULT_RCON_PASSWORD}" ]] \
|
||||
&& log "warning" "No RCON password has been defined within $(basename "${0}"), consider generating one with \"openssl rand -base64 36\""
|
||||
|
||||
sed -i "s/rcon.password=.+/rcon.password=${DEFAULT_RCON_PASSWORD}/g" server.properties \
|
||||
sed -i "s/rcon.password=.*/rcon.password=${DEFAULT_RCON_PASSWORD}/g" server.properties \
|
||||
&& log "info" "RCON password set"
|
||||
|
||||
sed -i "s/enable-rcon=false/enable-rcon=true/g" server.properties \
|
||||
&& log "info" "RCON Enabled"
|
||||
fi
|
||||
|
||||
## Accept the eula
|
||||
|
Loading…
Reference in New Issue
Block a user