Add Whiptail choice regarding

This commit is contained in:
deathbybandaid 2022-02-28 10:06:07 -05:00
parent ba9885a11e
commit f751b0d6d0

View File

@ -1,11 +1,16 @@
#!/bin/bash
echo "Setting up template environment" echo "Setting up template environment"
source ~/.bashrc source $HOME/.bashrc
## Update
echo "Running topgrade" echo "Running topgrade"
/opt/topgrade/topgrade /opt/topgrade/topgrade
echo "Checking if Directory $nssdb_dir contains Membership to FreeIPA Realm" ## FreeIPA Realm Join
if (whiptail --title "FreeIPA Relam Join" --yes-button "yes" --no-button "no" --yesno "Do You want to join a FreeIPA Realm?" 10 80)
then
echo "Checking if system already contains Membership to FreeIPA Realm"
realm_join=0 realm_join=0
if [[ ! -f /var/lib/ipa-client/sysrestore/sysrestore.state ]] if [[ ! -f /var/lib/ipa-client/sysrestore/sysrestore.state ]]
then then
@ -26,3 +31,6 @@ if [ "$realm_join" == 1 ]; then
freeipa_password=$(whiptail --passwordbox "Please enter the password for the FreeIPA admin user: $freeipa_admin" 8 78 --title "FreeIPA Password Prompt" 3>&1 1>&2 2>&3) freeipa_password=$(whiptail --passwordbox "Please enter the password for the FreeIPA admin user: $freeipa_admin" 8 78 --title "FreeIPA Password Prompt" 3>&1 1>&2 2>&3)
ipa-client-install --mkhomedir --no-ntp --principal="$freeipa_admin" --password="$freeipa_password" --enable-dns-updates --unattended ipa-client-install --mkhomedir --no-ntp --principal="$freeipa_admin" --password="$freeipa_password" --enable-dns-updates --unattended
fi fi
else
echo "Skipping realm joining"
fi