mirror of
https://github.com/PierreGode/Linux-Active-Directory-join-script.git
synced 2025-12-21 08:50:12 +01:00
Fixed Shellcheck warnings
Fixed Shellcheck warnings
This commit is contained in:
parent
74d6843539
commit
095ab9b91e
@ -6,7 +6,7 @@
|
|||||||
# Generic user setup is: administrator, domain admins, groupnamesudores= groupname=hostname + sudoers on groupname in AD groups #
|
# Generic user setup is: administrator, domain admins, groupnamesudores= groupname=hostname + sudoers on groupname in AD groups #
|
||||||
# Supported OS's: Ubuntu 14-18 + mate,Debian ,Cent OS,Rasbian ,Fedora.Linux Mint and Kali ( autodetect function ) #
|
# Supported OS's: Ubuntu 14-18 + mate,Debian ,Cent OS,Rasbian ,Fedora.Linux Mint and Kali ( autodetect function ) #
|
||||||
#This scrips is a long serie of small updates and not well planned, the script works as expected, but this is not beautiful code #
|
#This scrips is a long serie of small updates and not well planned, the script works as expected, but this is not beautiful code #
|
||||||
#Meaby someday I re-do the script and make it "good code" but overall it has NO shellcheck issues 2019-03-14 #
|
#Meaby someday I re-do the script and make it "good code" but overall it has minimal shellcheck issues #
|
||||||
##################################################################################################################################
|
##################################################################################################################################
|
||||||
#known bugs: Sometimes the script bugs after AD administrator tries to authenticate, temporary solution is running the script again
|
#known bugs: Sometimes the script bugs after AD administrator tries to authenticate, temporary solution is running the script again
|
||||||
# a couple of times. if it still is not working see line 24-25
|
# a couple of times. if it still is not working see line 24-25
|
||||||
@ -50,7 +50,7 @@ grouPs="null"
|
|||||||
therealm="null"
|
therealm="null"
|
||||||
cauth="null"
|
cauth="null"
|
||||||
clear
|
clear
|
||||||
read -p "${RED_TEXT}Do you wish to enable SSH login.group.allowed${END}${NUMBER}(y/n)?${END}" yn
|
read -r -p "${RED_TEXT}Do you wish to enable SSH login.group.allowed${END}${NUMBER}(y/n)?${END}" yn
|
||||||
case $yn in
|
case $yn in
|
||||||
[Yy]* ) sudo echo "Cheking if there is any previous configuration"
|
[Yy]* ) sudo echo "Cheking if there is any previous configuration"
|
||||||
if [ -f /etc/ssh/login.group.allowed ] < /dev/null > /dev/null 2>&1
|
if [ -f /etc/ssh/login.group.allowed ] < /dev/null > /dev/null 2>&1
|
||||||
@ -63,16 +63,16 @@ sudo touch /etc/ssh/login.group.allowed
|
|||||||
admins=$( grep home /etc/passwd | grep bash | cut -d ':' -f1 )
|
admins=$( grep home /etc/passwd | grep bash | cut -d ':' -f1 )
|
||||||
echo ""
|
echo ""
|
||||||
echo ""
|
echo ""
|
||||||
read -p "Is your current administrator = '$admins' ? (y/n)?" yn
|
read -r -p "Is your current administrator = '$admins' ? (y/n)?" yn
|
||||||
case $yn in
|
case $yn in
|
||||||
[Yy]* ) sudo echo "$admins" | sudo tee -a /etc/ssh/login.group.allowed;;
|
[Yy]* ) sudo echo "$admins" | sudo tee -a /etc/ssh/login.group.allowed;;
|
||||||
[Nn]* ) echo "please type name of current administrator"
|
[Nn]* ) echo "please type name of current administrator"
|
||||||
read -p MYADMIN
|
read -r -p MYADMIN
|
||||||
sudo echo "$MYADMIN" | sudo tee -a /etc/ssh/login.group.allowed;;
|
sudo echo "$MYADMIN" | sudo tee -a /etc/ssh/login.group.allowed;;
|
||||||
* ) echo "Please answer yes or no.";;
|
* ) echo "Please answer yes or no.";;
|
||||||
esac
|
esac
|
||||||
sudo echo "$NetBios\\$myhost""sudoers""" | sudo tee -a /etc/ssh/login.group.allowed
|
sudo echo "$NetBios\\$myhost""sudoers""" | sudo tee -a /etc/ssh/login.group.allowed
|
||||||
sudo echo echo "$NetBios\\domain^admins" | sudo tee -a /etc/ssh/login.group.allowed
|
sudo echo "$NetBios\\domain^admins" | sudo tee -a /etc/ssh/login.group.allowed
|
||||||
sudo echo "root" | sudo tee -a /etc/ssh/login.group.allowed
|
sudo echo "root" | sudo tee -a /etc/ssh/login.group.allowed
|
||||||
echo "enabled SSH-allow"
|
echo "enabled SSH-allow"
|
||||||
fi;;
|
fi;;
|
||||||
@ -83,7 +83,7 @@ fi;;
|
|||||||
echo ""
|
echo ""
|
||||||
echo "-------------------------------------------------------------------------------------------"
|
echo "-------------------------------------------------------------------------------------------"
|
||||||
echo ""
|
echo ""
|
||||||
read -p "${RED_TEXT}Do you wish to give users on this machine sudo rights?${END}${NUMBER}(y/n)?${END}" yn
|
read -r -p "${RED_TEXT}Do you wish to give users on this machine sudo rights?${END}${NUMBER}(y/n)?${END}" yn
|
||||||
case $yn in
|
case $yn in
|
||||||
[Yy]* ) sudo echo "Cheking if there is any previous configuration"
|
[Yy]* ) sudo echo "Cheking if there is any previous configuration"
|
||||||
if [ -f /etc/sudoers.d/sudoers ] < /dev/null > /dev/null 2>&1
|
if [ -f /etc/sudoers.d/sudoers ] < /dev/null > /dev/null 2>&1
|
||||||
@ -92,7 +92,7 @@ echo ""
|
|||||||
echo "The Sudoers file seems already to be modified, skipping..."
|
echo "The Sudoers file seems already to be modified, skipping..."
|
||||||
echo ""
|
echo ""
|
||||||
else
|
else
|
||||||
read -p "${RED_TEXT}Do you wish to DISABLE password promt for users in terminal?${END}${NUMBER}(y/n)?${END}" yn
|
read -r -p "${RED_TEXT}Do you wish to DISABLE password promt for users in terminal?${END}${NUMBER}(y/n)?${END}" yn
|
||||||
case $yn in
|
case $yn in
|
||||||
[Yy]* )
|
[Yy]* )
|
||||||
sudo echo "administrator ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/sudoers
|
sudo echo "administrator ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/sudoers
|
||||||
@ -257,7 +257,7 @@ grouPs="null"
|
|||||||
therealm="null"
|
therealm="null"
|
||||||
cauth="null"
|
cauth="null"
|
||||||
clear
|
clear
|
||||||
read -p 'Do you wish to enable SSH login.group.allowed (y/n)?' yn
|
read -r -p 'Do you wish to enable SSH login.group.allowed (y/n)?' yn
|
||||||
case $yn in
|
case $yn in
|
||||||
[Yy]* ) sudo echo "Cheking if there is any previous configuration"
|
[Yy]* ) sudo echo "Cheking if there is any previous configuration"
|
||||||
if [ -f /etc/ssh/login.group.allowed ] < /dev/null > /dev/null 2>&1
|
if [ -f /etc/ssh/login.group.allowed ] < /dev/null > /dev/null 2>&1
|
||||||
@ -270,11 +270,11 @@ sudo touch /etc/ssh/login.group.allowed
|
|||||||
admins=$( grep home /etc/passwd | grep bash | cut -d ':' -f1 )
|
admins=$( grep home /etc/passwd | grep bash | cut -d ':' -f1 )
|
||||||
echo ""
|
echo ""
|
||||||
echo ""
|
echo ""
|
||||||
read -p "Is your current administrator = $admins ? (y/n)?" yn
|
read -r -p "Is your current administrator = $admins ? (y/n)?" yn
|
||||||
case $yn in
|
case $yn in
|
||||||
[Yy]* ) sudo echo "$admins" | sudo tee -a /etc/ssh/login.group.allowed;;
|
[Yy]* ) sudo echo "$admins" | sudo tee -a /etc/ssh/login.group.allowed;;
|
||||||
[Nn]* ) echo "please type name of current administrator"
|
[Nn]* ) echo "please type name of current administrator"
|
||||||
read -p MYADMIN
|
read -r -p MYADMIN
|
||||||
sudo echo "$MYADMIN" | sudo tee -a /etc/ssh/login.group.allowed;;
|
sudo echo "$MYADMIN" | sudo tee -a /etc/ssh/login.group.allowed;;
|
||||||
* ) echo "Please answer yes or no.";;
|
* ) echo "Please answer yes or no.";;
|
||||||
esac
|
esac
|
||||||
@ -290,7 +290,7 @@ fi;;
|
|||||||
echo ""
|
echo ""
|
||||||
echo "-------------------------------------------------------------------------------------------"
|
echo "-------------------------------------------------------------------------------------------"
|
||||||
echo ""
|
echo ""
|
||||||
read -p 'Do you wish to give users on this machine sudo rights?(y/n)?' yn
|
read -r -p 'Do you wish to give users on this machine sudo rights?(y/n)?' yn
|
||||||
case $yn in
|
case $yn in
|
||||||
[Yy]* ) sudo echo "Cheking if there is any previous configuration"
|
[Yy]* ) sudo echo "Cheking if there is any previous configuration"
|
||||||
if [ -f /etc/sudoers.d/sudoers ] < /dev/null > /dev/null 2>&1
|
if [ -f /etc/sudoers.d/sudoers ] < /dev/null > /dev/null 2>&1
|
||||||
@ -299,7 +299,7 @@ echo ""
|
|||||||
echo "The Sudoers file seems already to be modified, skipping..."
|
echo "The Sudoers file seems already to be modified, skipping..."
|
||||||
echo ""
|
echo ""
|
||||||
else
|
else
|
||||||
read -p 'Do you wish to DISABLE password promt for users in terminal? (y/n)?' yn
|
read -r -p 'Do you wish to DISABLE password promt for users in terminal? (y/n)?' yn
|
||||||
case $yn in
|
case $yn in
|
||||||
[Yy]* )
|
[Yy]* )
|
||||||
sudo echo "administrator ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/sudoers
|
sudo echo "administrator ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/sudoers
|
||||||
@ -542,7 +542,7 @@ if [ $? = 0 ]
|
|||||||
then
|
then
|
||||||
clear
|
clear
|
||||||
echo "${NUMBER}I searched for an available domain and found ${MENU}>>> $DOMAIN <<<${END}${END}"
|
echo "${NUMBER}I searched for an available domain and found ${MENU}>>> $DOMAIN <<<${END}${END}"
|
||||||
read -p "Do you wish to use it (y/n)?" yn
|
read -r -p "Do you wish to use it (y/n)?" yn
|
||||||
case $yn in
|
case $yn in
|
||||||
[Yy]* ) echo "";;
|
[Yy]* ) echo "";;
|
||||||
|
|
||||||
@ -571,7 +571,7 @@ echo "${INTRO_TEXT}Joining Ubuntu $var${END}"
|
|||||||
echo ""
|
echo ""
|
||||||
echo "${INTRO_TEXT}Please log in with domain admin to $DOMAIN to connect${END}"
|
echo "${INTRO_TEXT}Please log in with domain admin to $DOMAIN to connect${END}"
|
||||||
echo "${INTRO_TEXT}Please type Admin user:${END}"
|
echo "${INTRO_TEXT}Please type Admin user:${END}"
|
||||||
read ADMIN
|
read -r ADMIN
|
||||||
sudo realm join -v -U "$ADMIN" "$DOMAIN" --install=/
|
sudo realm join -v -U "$ADMIN" "$DOMAIN" --install=/
|
||||||
else
|
else
|
||||||
if [ "$var" -eq "16" ]
|
if [ "$var" -eq "16" ]
|
||||||
@ -583,7 +583,7 @@ echo "${INTRO_TEXT}Joining Ubuntu $var${END}"
|
|||||||
echo ""
|
echo ""
|
||||||
echo "${INTRO_TEXT}Please log in with domain admin to $DOMAIN to connect${END}"
|
echo "${INTRO_TEXT}Please log in with domain admin to $DOMAIN to connect${END}"
|
||||||
echo "${INTRO_TEXT}Please type Admin user:${END}"
|
echo "${INTRO_TEXT}Please type Admin user:${END}"
|
||||||
read ADMIN
|
read -r ADMIN
|
||||||
sudo realm join --verbose --user="$ADMIN" "$DOMAIN"
|
sudo realm join --verbose --user="$ADMIN" "$DOMAIN"
|
||||||
else
|
else
|
||||||
if [ "$var" -eq "17" ] || [ "$var" -eq "18" ]
|
if [ "$var" -eq "17" ] || [ "$var" -eq "18" ]
|
||||||
@ -596,7 +596,7 @@ echo "${INTRO_TEXT}Joining Ubuntu $var${END}"
|
|||||||
echo ""
|
echo ""
|
||||||
echo "${INTRO_TEXT}Please log in with domain admin to $DOMAIN to connect${END}"
|
echo "${INTRO_TEXT}Please log in with domain admin to $DOMAIN to connect${END}"
|
||||||
echo "${INTRO_TEXT}Please type Admin user:${END}"
|
echo "${INTRO_TEXT}Please type Admin user:${END}"
|
||||||
read ADMIN
|
read -r ADMIN
|
||||||
sudo realm join --verbose --user="$ADMIN" "$DOMAIN" --install=/
|
sudo realm join --verbose --user="$ADMIN" "$DOMAIN" --install=/
|
||||||
else
|
else
|
||||||
clear
|
clear
|
||||||
@ -640,7 +640,7 @@ if [ $? = 0 ]
|
|||||||
then
|
then
|
||||||
clear
|
clear
|
||||||
echo "${NUMBER}I searched for an available domain and found ${MENU}>>> $DOMAIN <<<${END}${END}"
|
echo "${NUMBER}I searched for an available domain and found ${MENU}>>> $DOMAIN <<<${END}${END}"
|
||||||
read -p "Do you wish to use it (y/n)?" yn
|
read -r -p "Do you wish to use it (y/n)?" yn
|
||||||
case $yn in
|
case $yn in
|
||||||
[Yy]* ) echo "${INTRO_TEXT}Please log in with domain admin to $DOMAIN to connect${END}";;
|
[Yy]* ) echo "${INTRO_TEXT}Please log in with domain admin to $DOMAIN to connect${END}";;
|
||||||
|
|
||||||
@ -676,7 +676,7 @@ grouPs="null"
|
|||||||
therealm="null"
|
therealm="null"
|
||||||
cauth="null"
|
cauth="null"
|
||||||
clear
|
clear
|
||||||
read -p "${RED_TEXT}Do you wish to enable SSH login.group.allowed${END}${NUMBER}(y/n)?${END}" yn
|
read -r -p "${RED_TEXT}Do you wish to enable SSH login.group.allowed${END}${NUMBER}(y/n)?${END}" yn
|
||||||
case $yn in
|
case $yn in
|
||||||
[Yy]* ) sudo echo "Cheking if there is any previous configuration"
|
[Yy]* ) sudo echo "Cheking if there is any previous configuration"
|
||||||
if [ -f /etc/ssh/login.group.allowed ] < /dev/null > /dev/null 2>&1
|
if [ -f /etc/ssh/login.group.allowed ] < /dev/null > /dev/null 2>&1
|
||||||
@ -689,17 +689,17 @@ sudo touch /etc/ssh/login.group.allowed
|
|||||||
admins=$( grep home /etc/passwd | grep bash | cut -d ':' -f1 )
|
admins=$( grep home /etc/passwd | grep bash | cut -d ':' -f1 )
|
||||||
echo ""
|
echo ""
|
||||||
echo ""
|
echo ""
|
||||||
read -p "Is your current administrator = $admins ? (y/n)?" yn
|
read -r -p "Is your current administrator = $admins ? (y/n)?" yn
|
||||||
case $yn in
|
case $yn in
|
||||||
[Yy]* ) sudo echo "$admins" | sudo tee -a /etc/ssh/login.group.allowed;;
|
[Yy]* ) sudo echo "$admins" | sudo tee -a /etc/ssh/login.group.allowed;;
|
||||||
[Nn]* ) echo "please type name of current administrator"
|
[Nn]* ) echo "please type name of current administrator"
|
||||||
read -p MYADMIN
|
read -r -p MYADMIN
|
||||||
sudo echo "$MYADMIN" | sudo tee -a /etc/ssh/login.group.allowed;;
|
sudo echo "$MYADMIN" | sudo tee -a /etc/ssh/login.group.allowed;;
|
||||||
* ) echo "Please answer yes or no.";;
|
* ) echo "Please answer yes or no.";;
|
||||||
esac
|
esac
|
||||||
sudo echo "$Mysrvgroup" | sudo tee -a /etc/ssh/login.group.allowed
|
sudo echo "$Mysrvgroup" | sudo tee -a /etc/ssh/login.group.allowed
|
||||||
sudo echo "$NetBios\\$myhost""sudoers""" | sudo tee -a /etc/ssh/login.group.allowed
|
sudo echo "$NetBios\\$myhost""sudoers""" | sudo tee -a /etc/ssh/login.group.allowed
|
||||||
sudo echo echo "$NetBios\\domain^admins" | sudo tee -a /etc/ssh/login.group.allowed
|
sudo echo "$NetBios\\domain^admins" | sudo tee -a /etc/ssh/login.group.allowed
|
||||||
sudo echo "root" | sudo tee -a /etc/ssh/login.group.allowed
|
sudo echo "root" | sudo tee -a /etc/ssh/login.group.allowed
|
||||||
echo "enabled SSH-allow"
|
echo "enabled SSH-allow"
|
||||||
fi;;
|
fi;;
|
||||||
@ -710,7 +710,7 @@ fi;;
|
|||||||
echo ""
|
echo ""
|
||||||
echo "-------------------------------------------------------------------------------------------"
|
echo "-------------------------------------------------------------------------------------------"
|
||||||
echo ""
|
echo ""
|
||||||
read -p "${RED_TEXT}Do you wish to give users on this machine sudo rights?${END}${NUMBER}(y/n)?${END}" yn
|
read -r -p "${RED_TEXT}Do you wish to give users on this machine sudo rights?${END}${NUMBER}(y/n)?${END}" yn
|
||||||
case $yn in
|
case $yn in
|
||||||
[Yy]* ) sudo echo "Cheking if there is any previous configuration"
|
[Yy]* ) sudo echo "Cheking if there is any previous configuration"
|
||||||
if [ -f /etc/sudoers.d/sudoers ] < /dev/null > /dev/null 2>&1
|
if [ -f /etc/sudoers.d/sudoers ] < /dev/null > /dev/null 2>&1
|
||||||
@ -827,7 +827,7 @@ if [ $? = 0 ]
|
|||||||
then
|
then
|
||||||
clear
|
clear
|
||||||
echo "${NUMBER}I searched for an available domain and found $DOMAIN ${END}"
|
echo "${NUMBER}I searched for an available domain and found $DOMAIN ${END}"
|
||||||
read -p "Do you wish to use it (y/n)?" yn
|
read -r -p "Do you wish to use it (y/n)?" yn
|
||||||
case $yn in
|
case $yn in
|
||||||
[Yy]* ) echo "${INTRO_TEXT}Please log in with domain admin to $DOMAIN to connect${END}";;
|
[Yy]* ) echo "${INTRO_TEXT}Please log in with domain admin to $DOMAIN to connect${END}";;
|
||||||
|
|
||||||
@ -844,7 +844,7 @@ fi
|
|||||||
NetBios=$(echo "$DOMAIN" | cut -d '.' -f1)
|
NetBios=$(echo "$DOMAIN" | cut -d '.' -f1)
|
||||||
echo ""
|
echo ""
|
||||||
echo "${INTRO_TEXT}Please type Admin user:${END}"
|
echo "${INTRO_TEXT}Please type Admin user:${END}"
|
||||||
read ADMIN
|
read -r ADMIN
|
||||||
clear
|
clear
|
||||||
sudo echo "${INTRO_TEXT}Realm= $DOMAIN${END}"
|
sudo echo "${INTRO_TEXT}Realm= $DOMAIN${END}"
|
||||||
sudo echo "${NORMAL}${NORMAL}"
|
sudo echo "${NORMAL}${NORMAL}"
|
||||||
@ -902,7 +902,7 @@ if [ $? = 0 ]
|
|||||||
then
|
then
|
||||||
clear
|
clear
|
||||||
echo "${NUMBER}I searched for an available domain and found $DOMAIN ${END}"
|
echo "${NUMBER}I searched for an available domain and found $DOMAIN ${END}"
|
||||||
read -p "Do you wish to use it (y/n)?" yn
|
read -r -p "Do you wish to use it (y/n)?" yn
|
||||||
case $yn in
|
case $yn in
|
||||||
[Yy]* ) echo "${INTRO_TEXT}Please log in with domain admin to $DOMAIN to connect${END}";;
|
[Yy]* ) echo "${INTRO_TEXT}Please log in with domain admin to $DOMAIN to connect${END}";;
|
||||||
|
|
||||||
@ -919,7 +919,7 @@ fi
|
|||||||
NetBios=$(echo "$DOMAIN" | cut -d '.' -f1)
|
NetBios=$(echo "$DOMAIN" | cut -d '.' -f1)
|
||||||
echo ""
|
echo ""
|
||||||
echo "${INTRO_TEXT}Please type Admin user:${END}"
|
echo "${INTRO_TEXT}Please type Admin user:${END}"
|
||||||
read ADMIN
|
read -r ADMIN
|
||||||
clear
|
clear
|
||||||
sudo echo "${INTRO_TEXT}Realm= $DOMAIN${END}"
|
sudo echo "${INTRO_TEXT}Realm= $DOMAIN${END}"
|
||||||
sudo echo "${NORMAL}${NORMAL}"
|
sudo echo "${NORMAL}${NORMAL}"
|
||||||
@ -946,7 +946,7 @@ if [ $? = 0 ]
|
|||||||
then
|
then
|
||||||
clear
|
clear
|
||||||
echo "I searched for an available domain and found >>> $DOMAIN <<<"
|
echo "I searched for an available domain and found >>> $DOMAIN <<<"
|
||||||
read -p "Do you wish to use it (y/n)?" yn
|
read -r -p "Do you wish to use it (y/n)?" yn
|
||||||
case $yn in
|
case $yn in
|
||||||
[Yy]* ) echo "Please log in with domain admin to $DOMAIN to connect"
|
[Yy]* ) echo "Please log in with domain admin to $DOMAIN to connect"
|
||||||
sudo echo "Please enter AD admin user:"
|
sudo echo "Please enter AD admin user:"
|
||||||
@ -1038,7 +1038,7 @@ if [ $? = 0 ]
|
|||||||
then
|
then
|
||||||
clear
|
clear
|
||||||
echo "I searched for an available domain and found >>> $DOMAIN <<<"
|
echo "I searched for an available domain and found >>> $DOMAIN <<<"
|
||||||
read -p "Do you wish to use it (y/n)?" yn
|
read -r -p "Do you wish to use it (y/n)?" yn
|
||||||
case $yn in
|
case $yn in
|
||||||
[Yy]* ) echo "Please log in with domain admin to $DOMAIN to connect";;
|
[Yy]* ) echo "Please log in with domain admin to $DOMAIN to connect";;
|
||||||
|
|
||||||
@ -1082,7 +1082,7 @@ if [ "$?" = "0" ]
|
|||||||
then
|
then
|
||||||
clear
|
clear
|
||||||
echo "${NUMBER}I searched for an available domain and found ${MENU}>>> $DOMAIN <<<${END}${END}"
|
echo "${NUMBER}I searched for an available domain and found ${MENU}>>> $DOMAIN <<<${END}${END}"
|
||||||
read -p "Do you wish to use it (y/n)?" yn
|
read -r -p "Do you wish to use it (y/n)?" yn
|
||||||
case $yn in
|
case $yn in
|
||||||
[Yy]* ) echo "";;
|
[Yy]* ) echo "";;
|
||||||
|
|
||||||
@ -1099,7 +1099,7 @@ fi
|
|||||||
clear
|
clear
|
||||||
echo "${INTRO_TEXT}Please log in with domain admin to $DOMAIN to connect${END}"
|
echo "${INTRO_TEXT}Please log in with domain admin to $DOMAIN to connect${END}"
|
||||||
echo "${INTRO_TEXT}Please type Admin user:${END}"
|
echo "${INTRO_TEXT}Please type Admin user:${END}"
|
||||||
read ADMIN
|
read -r ADMIN
|
||||||
NetBios=$(echo "$DOMAIN" | cut -d '.' -f1)
|
NetBios=$(echo "$DOMAIN" | cut -d '.' -f1)
|
||||||
clear
|
clear
|
||||||
sudo realm join --verbose --user="$ADMIN" "$DOMAIN"
|
sudo realm join --verbose --user="$ADMIN" "$DOMAIN"
|
||||||
@ -1287,7 +1287,7 @@ then
|
|||||||
echo "ldap tool installed.. trying to find this host"
|
echo "ldap tool installed.. trying to find this host"
|
||||||
sudo ldapsearch cn="$myhost'*'"
|
sudo ldapsearch cn="$myhost'*'"
|
||||||
echo "Please type what you are looking for"
|
echo "Please type what you are looking for"
|
||||||
read own
|
read -r own
|
||||||
sudo ldapsearch | grep -i "$own"
|
sudo ldapsearch | grep -i "$own"
|
||||||
exit
|
exit
|
||||||
else
|
else
|
||||||
@ -1329,7 +1329,7 @@ else
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
read -p "Do you really want to leave the domain: $DOMAIN (y/n)?" yn
|
read -r -p "Do you really want to leave the domain: $DOMAIN (y/n)?" yn
|
||||||
case $yn in
|
case $yn in
|
||||||
[Yy]* ) echo "Listing domain"
|
[Yy]* ) echo "Listing domain"
|
||||||
sudo realm discover "$DOMAIN"
|
sudo realm discover "$DOMAIN"
|
||||||
@ -1386,7 +1386,7 @@ else
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
read -p "Do you really want to leave the domain: $DOMAIN (y/n)?" yn
|
read -r -p "Do you really want to leave the domain: $DOMAIN (y/n)?" yn
|
||||||
case $yn in
|
case $yn in
|
||||||
[Yy]* ) echo "Listing domain"
|
[Yy]* ) echo "Listing domain"
|
||||||
sudo realm discover "$DOMAIN"
|
sudo realm discover "$DOMAIN"
|
||||||
@ -1434,7 +1434,7 @@ echo " [-l (script output to log file)]"
|
|||||||
echo " [-s (Discover domain)]"
|
echo " [-s (Discover domain)]"
|
||||||
echo " [-o (assign OU for computer object (-o OU=Clients,OU=Computers))"
|
echo " [-o (assign OU for computer object (-o OU=Clients,OU=Computers))"
|
||||||
echo ""
|
echo ""
|
||||||
echo""
|
echo ""
|
||||||
echo "${INTRO_TEXT} Active directory connection tool ${END}"
|
echo "${INTRO_TEXT} Active directory connection tool ${END}"
|
||||||
echo "${INTRO_TEXT} Examples ${END}"
|
echo "${INTRO_TEXT} Examples ${END}"
|
||||||
echo "${INTRO_TEXT} Domain to join:${RED_TEXT}Example:${RED_TEXT}${NUMBER}mydomain.intra${NUMBER}${END}"
|
echo "${INTRO_TEXT} Domain to join:${RED_TEXT}Example:${RED_TEXT}${NUMBER}mydomain.intra${NUMBER}${END}"
|
||||||
@ -1474,7 +1474,7 @@ clear
|
|||||||
echo "${MENU}*${NUMBER} 5)${MENU} Leave Domain ${END}"
|
echo "${MENU}*${NUMBER} 5)${MENU} Leave Domain ${END}"
|
||||||
echo "${NORMAL} ${END}"
|
echo "${NORMAL} ${END}"
|
||||||
echo "${ENTER_LINE}Please enter a menu option and enter or ${RED_TEXT}ctrl + c to exit. ${END}"
|
echo "${ENTER_LINE}Please enter a menu option and enter or ${RED_TEXT}ctrl + c to exit. ${END}"
|
||||||
read opt
|
read -r opt
|
||||||
while [ "$opt" != '' ]
|
while [ "$opt" != '' ]
|
||||||
do
|
do
|
||||||
if [ "$opt" = "" ]; then
|
if [ "$opt" = "" ]; then
|
||||||
@ -1530,7 +1530,7 @@ clear
|
|||||||
echo "5) Leave Domain"
|
echo "5) Leave Domain"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Please enter a menu option and enter or enter to exit."
|
echo "Please enter a menu option and enter or enter to exit."
|
||||||
read opt
|
read -r opt
|
||||||
while [ "$opt" != '' ]
|
while [ "$opt" != '' ]
|
||||||
do
|
do
|
||||||
if [ "$opt" = "" ]; then
|
if [ "$opt" = "" ]; then
|
||||||
@ -1698,7 +1698,7 @@ if [ $? = 0 ]
|
|||||||
then
|
then
|
||||||
clear
|
clear
|
||||||
echo "${NUMBER}I searched for an available domain and found ${MENU}>>> $DOMAIN <<<${END}${END}"
|
echo "${NUMBER}I searched for an available domain and found ${MENU}>>> $DOMAIN <<<${END}${END}"
|
||||||
read -p "Do you wish to use it (y/n)?" yn
|
read -r -p "Do you wish to use it (y/n)?" yn
|
||||||
case $yn in
|
case $yn in
|
||||||
[Yy]* ) echo "";;
|
[Yy]* ) echo "";;
|
||||||
|
|
||||||
@ -1727,7 +1727,7 @@ echo "${INTRO_TEXT}Joining Ubuntu $var${END}"
|
|||||||
echo ""
|
echo ""
|
||||||
echo "${INTRO_TEXT}Please log in with domain admin to $DOMAIN to connect${END}"
|
echo "${INTRO_TEXT}Please log in with domain admin to $DOMAIN to connect${END}"
|
||||||
echo "${INTRO_TEXT}Please type Admin user:${END}"
|
echo "${INTRO_TEXT}Please type Admin user:${END}"
|
||||||
read ADMIN
|
read -r ADMIN
|
||||||
realm join -v --user="$ADMIN" --computer-ou="$2" "$DOMAIN" --install=/
|
realm join -v --user="$ADMIN" --computer-ou="$2" "$DOMAIN" --install=/
|
||||||
else
|
else
|
||||||
if [ "$var" -eq "16" ]
|
if [ "$var" -eq "16" ]
|
||||||
@ -1739,7 +1739,7 @@ echo "${INTRO_TEXT}Joining Ubuntu $var${END}"
|
|||||||
echo ""
|
echo ""
|
||||||
echo "${INTRO_TEXT}Please log in with domain admin to $DOMAIN to connect${END}"
|
echo "${INTRO_TEXT}Please log in with domain admin to $DOMAIN to connect${END}"
|
||||||
echo "${INTRO_TEXT}Please type Admin user:${END}"
|
echo "${INTRO_TEXT}Please type Admin user:${END}"
|
||||||
read ADMIN
|
read -r ADMIN
|
||||||
realm join -v --user="$ADMIN" --computer-ou="$2" "$DOMAIN"
|
realm join -v --user="$ADMIN" --computer-ou="$2" "$DOMAIN"
|
||||||
else
|
else
|
||||||
if [ "$var" -eq "17" ] || [ "$var" -eq "18" ]
|
if [ "$var" -eq "17" ] || [ "$var" -eq "18" ]
|
||||||
@ -1752,7 +1752,7 @@ echo "${INTRO_TEXT}Joining Ubuntu $var${END}"
|
|||||||
echo ""
|
echo ""
|
||||||
echo "${INTRO_TEXT}Please log in with domain admin to $DOMAIN to connect${END}"
|
echo "${INTRO_TEXT}Please log in with domain admin to $DOMAIN to connect${END}"
|
||||||
echo "${INTRO_TEXT}Please type Admin user:${END}"
|
echo "${INTRO_TEXT}Please type Admin user:${END}"
|
||||||
read ADMIN
|
read -r ADMIN
|
||||||
realm join -v --user="$ADMIN" --computer-ou="$2" "$DOMAIN" --install=/
|
realm join -v --user="$ADMIN" --computer-ou="$2" "$DOMAIN" --install=/
|
||||||
else
|
else
|
||||||
clear
|
clear
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user