Active directory Join script for Ubuntu, Debian, CentOS and Raspberry Pi

Active directory Join script for Ubuntu, Debian, CentOS and Raspberry Pi
with built in failchcheck and debugmode for Ubuntu.
This commit is contained in:
PierreGoude 2017-10-05 09:53:14 +02:00
parent 03d56a0b29
commit a6ed8077e9

View File

@ -28,6 +28,7 @@ sudo apt-get update
sudo apt-get install packagekit sudo apt-get install packagekit
} }
#fixerrors #fixerrors
####################### Setup for Ubuntu 14,16 and 17 clients ####################################### ####################### Setup for Ubuntu 14,16 and 17 clients #######################################
ubuntuclient(){ ubuntuclient(){
desktop=$(sudo apt list --installed | grep -i desktop | grep -i ubuntu | cut -d '-' -f1 | grep -i desktop) desktop=$(sudo apt list --installed | grep -i desktop | grep -i ubuntu | cut -d '-' -f1 | grep -i desktop)
@ -257,6 +258,7 @@ fi
} }
####################### Setup for Ubuntu16 and Ubuntu 14 clients debug mode ###################################### ####################### Setup for Ubuntu16 and Ubuntu 14 clients debug mode ######################################
ubuntuclientdebug(){ ubuntuclientdebug(){
desktop=$(sudo apt list --installed | grep -i desktop | grep -i ubuntu | cut -d '-' -f1 | grep -i desktop) desktop=$(sudo apt list --installed | grep -i desktop | grep -i ubuntu | cut -d '-' -f1 | grep -i desktop)
gnome-terminal --geometry=130x20 -e "bash -c \"journalctl -fxe; exec bash\"" gnome-terminal --geometry=130x20 -e "bash -c \"journalctl -fxe; exec bash\""
@ -486,6 +488,7 @@ fi
} }
####################### Setup for Ubuntu server ####################################### ####################### Setup for Ubuntu server #######################################
ubuntuserver14(){ ubuntuserver14(){
export HOSTNAME export HOSTNAME
myhost=$( hostname ) myhost=$( hostname )
@ -657,6 +660,7 @@ eof
} }
####################################### Cent OS ######################################### ####################################### Cent OS #########################################
# Functional but ugly # Functional but ugly
CentOS(){ CentOS(){
export HOSTNAME export HOSTNAME
@ -799,6 +803,8 @@ eof
} }
############################### Raspberry Pi ################################### ############################### Raspberry Pi ###################################
#not tested yet
raspberry(){ raspberry(){
export HOSTNAME export HOSTNAME
myhost=$( hostname ) myhost=$( hostname )
@ -833,6 +839,7 @@ echo "override_homedir = /home/%d/%u" >> /etc/sssd/sssd.conf
eof eof
} }
############################### Update to Realmd from likewise ################## ############################### Update to Realmd from likewise ##################
Realmdupdate(){ Realmdupdate(){
export HOSTNAME export HOSTNAME
myhost=$( hostname ) myhost=$( hostname )
@ -919,6 +926,7 @@ eof
} }
############################### Fail check #################################### ############################### Fail check ####################################
failcheck(){ failcheck(){
clear clear
export HOSTNAME export HOSTNAME
@ -987,6 +995,7 @@ exit
#################################### ldapsearch ##################################################### #################################### ldapsearch #####################################################
ldaplook(){ ldaplook(){
export HOSTNAME export HOSTNAME
myhost=$( hostname ) myhost=$( hostname )
@ -1012,6 +1021,7 @@ fi
} }
############################### Reauth ########################################## ############################### Reauth ##########################################
Reauthenticate14(){ Reauthenticate14(){
DOMAIN=$(realm discover | grep -i realm.name | cut -d ':' -f2 | sed -e 's/^[[:space:]]*//') DOMAIN=$(realm discover | grep -i realm.name | cut -d ':' -f2 | sed -e 's/^[[:space:]]*//')
read -p "Do you wish to use it (y/n)?" yn read -p "Do you wish to use it (y/n)?" yn
@ -1031,6 +1041,7 @@ exit
} }
########################################### info ####################################### ########################################### info #######################################
readmes(){ readmes(){
clear clear
echo "${INTRO_TEXT} Active directory connection tool Realmd ${INTRO_TEXT}" echo "${INTRO_TEXT} Active directory connection tool Realmd ${INTRO_TEXT}"
@ -1055,7 +1066,9 @@ echo "${INTRO_TEXT} Ubuntu 16 and 14 has the setting not to show domain name in
echo "${INTRO_TEXT} coding issues when building.. to change this configure /et/sssd/sssd.conf ${INTRO_TEXT}" echo "${INTRO_TEXT} coding issues when building.. to change this configure /et/sssd/sssd.conf ${INTRO_TEXT}"
exit exit
} }
########################################### Menu ####################################### ########################################### Menu #######################################
clear clear
echo "${INTRO_TEXT} Active directory connection tool ${INTRO_TEXT}" echo "${INTRO_TEXT} Active directory connection tool ${INTRO_TEXT}"
echo "${INTRO_TEXT} Created by Pierre Goude ${INTRO_TEXT}" echo "${INTRO_TEXT} Created by Pierre Goude ${INTRO_TEXT}"