From 13543beea83ce691d406884cc551dc6a24fecadb Mon Sep 17 00:00:00 2001 From: PierreGode Date: Tue, 27 Mar 2018 09:26:37 +0200 Subject: [PATCH] Update ADconnection.sh --- ADconnection.sh | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/ADconnection.sh b/ADconnection.sh index ee80fbd..5de5b07 100644 --- a/ADconnection.sh +++ b/ADconnection.sh @@ -219,28 +219,30 @@ linuxclient } ################################## Join for linux clients ########################################## - linuxclient(){ -desktop=$(sudo apt list --installed | grep -i desktop | grep -i ubuntu | cut -d '-' -f1 | grep -i desktop) -if [ $? = 0 ] +desktop=$( sudo apt list --installed | grep -i desktop | grep -i ubuntu | cut -d '-' -f1 | grep -i desktop ) +rasp=$( lsb_release -a | grep -i Distributor | awk '{print $3}' ) +kalilinux=$( lsb_release -a | grep -i Distributor | awk '{print $3}' ) + +if [ "$desktop" = "desktop" ] then - rasp=$( lsb_release -a | grep -i Distributor | awk '{print $3}' ) - if [ "$rasp" = "Raspbian" ] - then - echo "${INTRO_TEXT}"Detecting Raspberry Pi"${END}" - raspberry - else - kalilinux=$( lsb_release -a | grep -i Distributor | awk '{print $3}' ) - if [ "$kalilinux" = "Kali" ] - then - echo "${INTRO_TEXT}"Detecting Kali linux"${END}" - kalijoin - else - echo " this seems to be a server, swithching to server mode" - ubuntuserver14 +if [ "$rasp" = "Raspbian" ] +then +echo "${INTRO_TEXT}"Detecting Raspberry Pi"${END}" +raspberry +else +if [ "$kalilinux" = "Kali" ] +then +echo "${INTRO_TEXT}"Detecting Kali linux"${END}" +kalijoin +else +echo "" +fi +fi +else +echo " this seems to be a server, swithching to server mode" +ubuntuserver14 fi - fi - fi export HOSTNAME myhost=$( hostname ) clear