diff --git a/template_setup.sh b/template_setup.sh index 031f8f8..518876c 100644 --- a/template_setup.sh +++ b/template_setup.sh @@ -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