MC conf update -- AWS DDNS

This commit is contained in:
Price Hiller 2021-08-02 07:06:49 -05:00
parent e552eb93ef
commit fbd16211a0
2 changed files with 38 additions and 1 deletions

34
AWS/DDNS.bash Executable file
View 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}"))"

View File

@ -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