2021-07-05 06:50:25 +00:00
|
|
|
#!/bin/bash
|
|
|
|
if m_getArch aarch64 | grep -qE 'aarch64'; then
|
|
|
|
r_log "ipa -bash" "Skipping for aarch64"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$IPAINSTALLED" -eq 1 ]; then
|
|
|
|
r_log "ipa" "IPA was not successfully installed. Aborting."
|
|
|
|
r_checkExitStatus 1
|
|
|
|
fi
|
|
|
|
|
2022-06-20 23:49:14 +00:00
|
|
|
kdestroy &> /dev/null
|
|
|
|
klist 2>&1 | grep -qE "(No credentials|Credentials cache .* not found)" &> /dev/null
|
|
|
|
r_checkExitStatus $?
|
|
|
|
|
2022-06-30 03:45:58 +00:00
|
|
|
echo "b1U3OnyX!" | kinit admin@RLIPA.LOCAL
|
2022-06-20 23:49:14 +00:00
|
|
|
|
|
|
|
klist | grep "admin@RLIPA.LOCAL" &> /dev/null
|
|
|
|
r_checkExitStatus $?
|
|
|
|
|
|
|
|
r_log "ipa" "Adding testzone subdomain"
|
2022-06-30 04:27:50 +00:00
|
|
|
ipa dnszone-add --name-server=onyxtest.rlipa.local. --admin-email=hostmaster.testzone.rlipa.local. testzone.rlipa.local &> /dev/null
|
2022-06-20 23:49:14 +00:00
|
|
|
r_checkExitStatus $?
|
|
|
|
sleep 5
|
|
|
|
|
|
|
|
r_log "ipa" "Get SOA from testzone subdomain"
|
|
|
|
dig @localhost SOA testzone.rlipa.local | grep -q "status: NOERROR" &> /dev/null
|
|
|
|
r_checkExitStatus $?
|
|
|
|
|
|
|
|
r_log "ipa" "Adding a CNAME record to the primary domain"
|
2022-06-30 04:27:50 +00:00
|
|
|
ipa dnsrecord-add rlipa.local testrecord --cname-hostname=onyxtest &> /dev/null
|
2022-06-20 23:49:14 +00:00
|
|
|
r_checkExitStatus $?
|
|
|
|
sleep 5
|
|
|
|
|
|
|
|
r_log "ipa" "Retrieving CNAME record"
|
|
|
|
dig @localhost CNAME testrecord.rlipa.local | grep -q "status: NOERROR" &> /dev/null
|
|
|
|
r_checkExitStatus $?
|
|
|
|
|
|
|
|
r_log "ipa" "Adding a CNAME to subdomain"
|
2022-06-30 04:27:50 +00:00
|
|
|
ipa dnsrecord-add testzone.rlipa.local testrecord --cname-hostname=onyxtest.rlipa.local. &> /dev/null
|
2022-06-20 23:49:14 +00:00
|
|
|
r_checkExitStatus $?
|
|
|
|
sleep 5
|
|
|
|
|
|
|
|
r_log "ipa" "Testing can retrieve record from subdomain"
|
|
|
|
dig @localhost CNAME testrecord.testzone.rlipa.local | grep -q "status: NOERROR" &> /dev/null
|
|
|
|
r_checkExitStatus $?
|