This should work

This commit is contained in:
deathbybandaid 2022-02-18 11:40:19 -05:00
parent f676f9f52e
commit 6c3662a2e2

View File

@ -3,20 +3,14 @@ echo "Setting up template environment"
echo "Running topgrade"
/opt/topgrade/topgrade
nssdb_dir="/etc/ipa/nssdb"
echo "Checking if Directory $nssdb_dir contains Membership to FreeIPA Realm"
realm_join=0
if [ -d "$nssdb_dir" ]
if [[ -f /var/lib/ipa-client/sysrestore/sysrestore.state ]]
then
if [ "$(ls -A $nssdb_dir)" ]; then
echo "Directory $nssdb_dir is not Empty."
realm_join=1
echo "ipa-client appears to already be joined to FreeIPA Server Realm"
else
echo "$nssdb_dir is Empty"
fi
echo "$HOSTNAME appears to not be joined to FreeIPA Server Realm"
realm_join=1
else
echo "Directory $nssdb_dir not found."
echo "$HOSTNAME appears to already be joined to FreeIPA Server Realm"
fi
if [[ $HOSTNAME == *template* ]]; then