diff --git a/iso/installer/install.sh b/iso/installer/install.sh index 7ed3e67e..c70966e9 100755 --- a/iso/installer/install.sh +++ b/iso/installer/install.sh @@ -244,42 +244,43 @@ if [ -f $myCONF_FILE ]; myCONF_NTP_USE="1" fi + ### <--- Begin proxy setup # If a proxy is set in iso.conf it needs to be setup. # However, none of the other installation types will automatically take care of a proxy. # Please open a feature request if you think this is something worth considering. -if [ "$myCONF_PROXY_USE" == "0" ]; -then -dialog --title "[ Setting up the proxy ]" $myPROGRESSBOXCONF <&1>/dev/null <&1>/dev/null <&1 | dialog --title "[ Stop docker service ]" $myPROGRESSBOXCONF -systemctl start docker 2>&1 | dialog --title "[ Start docker service ]" $myPROGRESSBOXCONF +if [ "$myCONF_PROXY_USE" == "0" ]; + then + # Let's setup proxy for the environment + echo "$myPROXY_ENV" 2>&1 | tee -a /etc/environment | dialog --title "[ Setting up the proxy ]" $myPROGRESSBOXCONF + source /etc/environment + + # Let's setup the proxy for apt + echo "$myPROXY_APT" 2>&1 | tee /etc/apt/apt.conf | dialog --title "[ Setting up the proxy ]" $myPROGRESSBOXCONF + + # Let's add proxy settings to docker defaults + echo "$myPROXY_DOCKER" 2>&1 | tee -a /etc/default/docker | dialog --title "[ Setting up the proxy ]" $myPROGRESSBOXCONF + + # Let's restart docker for proxy changes to take effect + systemctl stop docker 2>&1 | dialog --title "[ Stop docker service ]" $myPROGRESSBOXCONF + systemctl start docker 2>&1 | dialog --title "[ Start docker service ]" $myPROGRESSBOXCONF fi ### ---> End proxy setup @@ -290,10 +291,8 @@ if [ "$myTPOT_DEPLOYMENT_TYPE" == "iso" ] || [ "$myTPOT_DEPLOYMENT_TYPE" == "use j=0 for i in $mySITES; do - dialog --title "[ Testing the internet connection ]" --backtitle "$myBACKTITLE" \ - --gauge "\n Now checking: $i\n" 8 80 $(expr 100 \* $j / $mySITESCOUNT) <&1>/dev/null + curl --connect-timeout 30 -IsS $i 2>&1>/dev/null | dialog --title "[ Testing the internet connection ]" --backtitle "$myBACKTITLE" \ + --gauge "\n Now checking: $i\n" 8 80 $(expr 100 \* $j / $mySITESCOUNT) if [ $? -ne 0 ]; then dialog --backtitle "$myBACKTITLE" --title "[ Continue? ]" --yesno "\nInternet connection test failed. This might indicate some problems with your connection. You can continue, but the installation might fail." 10 50 @@ -306,12 +305,10 @@ EOF fi; fi; let j+=1 - dialog --title "[ Testing the internet connection ]" --backtitle "$myBACKTITLE" \ - --gauge "\n Now checking: $i\n" 8 80 $(expr 100 \* $j / $mySITESCOUNT) <&1>/dev/null | dialog --title "[ Testing the internet connection ]" --backtitle "$myBACKTITLE" \ + --gauge "\n Now checking: $i\n" 8 80 $(expr 100 \* $j / $mySITESCOUNT) done; fi - # Let's put cursor back in standard form tput cnorm @@ -457,24 +454,17 @@ fi # Let's setup the ntp server if [ "$myCONF_NTP_USE" == "0" ]; then - dialog --title "[ Setting up the ntp server ]" $myPROGRESSBOXCONF <&1 | dialog --title "[ Setting up the ntp server ]" $myPROGRESSBOXCONF fi # Let's setup 802.1x networking -if [ "myCONF_PFX_USE" == "0" ]; - then - dialog --title "[ Setting 802.1x networking ]" $myPROGRESSBOXCONF <&1 | dialog --title "[ Setting 802.1x networking ]" $myPROGRESSBOXCONF - tee -a /etc/network/interfaces 2>&1>/dev/null <&1>/dev/null <&1>/dev/null <&1 | dialog --title "[ Setting 802.1x networking ]" $myPROGRESSBOXCONF + echo "$myNETWORK_INTERFACES" 2>&1 | tee -a /etc/network/interfaces | dialog --title "[ Setting 802.1x networking ]" $myPROGRESSBOXCONF + + echo "$myNETWORK_WIRED8021x" 2>&1 | tee /etc/wpa_supplicant/wired8021x.conf | dialog --title "[ Setting 802.1x networking ]" $myPROGRESSBOXCONF + + echo "$myNETWORK_WLAN8021x" 2>&1 | tee /etc/wpa_supplicant/wireless8021x.conf | dialog --title "[ Setting 802.1x networking ]" $myPROGRESSBOXCONF fi # Let's provide a wireless example config ... -fuECHO "### Providing static ip, wireless example config." -tee -a /etc/network/interfaces 2>&1>/dev/null <" -EOF +# wpa-psk \"\" +" +echo "$myNETWORK_WLANEXAMPLE" 2>&1 | tee -a /etc/network/interfaces | dialog --title "[ Provide WLAN example config ]" $myPROGRESSBOXCONF # Let's modify the sources list sed -i '/cdrom/d' /etc/apt/sources.list # Let's make sure SSH roaming is turned off (CVE-2016-0777, CVE-2016-0778) -fuECHO "### Let's make sure SSH roaming is turned off." -tee -a /etc/ssh/ssh_config 2>&1>/dev/null <&1 | tee -a /etc/ssh/ssh_config | dialog --title "[ Turn SSH roaming off ]" $myPROGRESSBOXCONF # Installing ctop, elasticdump, tpot, yq if ! [ "$myCONF_TPOT_FLAVOR" == "SENSOR" ]; @@ -617,20 +607,15 @@ case $myCONF_TPOT_FLAVOR in ;; esac -# Let's load docker images -myIMAGESCOUNT=$(cat $myTPOTCOMPOSE | grep -v '#' | grep image | cut -d: -f2 | uniq | wc -l) -j=0 +# Let's load docker images in parallel +function fuPULLIMAGES { for name in $(cat $myTPOTCOMPOSE | grep -v '#' | grep image | cut -d'"' -f2 | uniq) do - dialog --title "[ Downloading docker images, please be patient ]" --backtitle "$myBACKTITLE" \ - --gauge "\n Now downloading: $name\n" 8 80 $(expr 100 \* $j / $myIMAGESCOUNT) <&1>/dev/null - let j+=1 - dialog --title "[ Downloading docker images, please be patient ]" --backtitle "$myBACKTITLE" \ - --gauge "\n Now downloading: $name\n" 8 80 $(expr 100 \* $j / $myIMAGESCOUNT) <&1 | dialog --title "[ Pulling docker images, please be patient ]" $myPROGRESSBOXCONF # Let's add the daily update check with a weekly clean interval dialog --title "[ Modifying update checks ]" $myPROGRESSBOXCONF <