diff --git a/domainjoin.sh b/domainjoin.sh index 65e6e78..53ca077 100644 --- a/domainjoin.sh +++ b/domainjoin.sh @@ -22,12 +22,15 @@ fi echo "[active-directory]" > /etc/realmd.conf echo "os-name = ${OS}" >> /etc/realmd.conf echo "os-version = ${OS_VER}" >> /etc/realmd.conf -echo "[service]" >> /etc/realmd.conf -echo "automatic-install = no" >> /etc/realmd.conf # join the computer to the domain -echo ${password} | realm join -U ${username} ${domain} +if [ ${OS} == "Debian" ] || [ ${OS} == "Ubuntu" ]; then + echo ${password} | realm join -U ${username} --install=/ ${domain} +elif [ "${OS}" == "CentOS" ]; then + echo ${password} | realm join -U ${username} ${domain} +fi + # set the sssd options # don't require the full domain for the usernames