Votre Nom 3 years ago
parent
commit
531f08e0e9
1 changed files with 51 additions and 25 deletions
  1. 51 25
      build_cube.sh

+ 51 - 25
build_cube.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 set -e
-Version=4.6
+Version=4.7
 Cuda=YES
 ZFS=NO
 Drivers=RAW
@@ -45,19 +45,23 @@ print_centered "╚██████╗╚██████╔╝████
 print_centered " ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝"
 echo -n "$(tput setaf 7)"
 print_centered "Cube Server installation script v$Version"
-sleep 5
+sleep 2
 }
 
 function update_ {
+if [ ! -f /home/wareck/.pass1 ] && [ ! -f /home/wareck/.pass2 ]  && [ ! -f /home/wareck/.pass3 ] && [ ! -f /home/wareck/.pass4 ]
+then
 echo -e "$(tput setaf 10)\nUpdate and install packages:$(tput sgr0)"
 sudo apt-get update
-sudo apt-get install samba cifs-utils mdadm git build-essential libtool pkg-config automake autoconf ethtool net-tools openvpn filezilla \
-tasksel lzma-dev lzma cmake libuv1-dev libssl-dev msr-tools tightvncserver lm-sensors openssh-server -y
 echo -e ""
-sudo apt-get install pixz pbzip2 pigz btrfs-progs htop lxde lxde-icon-theme gparted gnome-remote-desktop libcanberra-gtk-module \
+sudo apt-get install htop pixz pbzip2 pigz btrfs-progs lxde lxde-icon-theme gparted gnome-remote-desktop libcanberra-gtk-module \
 ctorrent libcurl4-openssl-dev bison byacc screen libudev-dev libjansson-dev libncurses5-dev libmicrohttpd-dev curl -y
 echo -e ""
+sudo apt-get install samba cifs-utils mdadm git build-essential libtool pkg-config automake autoconf ethtool net-tools openvpn filezilla \
+tasksel lzma-dev lzma cmake libuv1-dev libssl-dev msr-tools tightvncserver lm-sensors openssh-server -y
+echo -e ""
 sudo apt-get install libglib2.0-dev libgtk2.0-dev libsensors4-dev htop vlc locate -y
+echo -e ""
 if [ $ZFS = "YES" ]
 then
 sudo apt-get install zfsutils-linux -y
@@ -68,11 +72,12 @@ echo -e "$(tput setaf 10)\nInstall Cuda packages:$(tput sgr0)"
 sudo apt-get install nvidia-cuda-toolkit -y
 echo -e "Done."
 fi
+fi
 }
 
 function decompte_ {
 echo -e "$(tput setaf 10)\nReboot in 10 seconds (CRTL+C to abord):$(tput sgr0)"
-for i in {10..1}
+for i in {10..0}
 do
 echo -e -n "$i "
 sleep 1
@@ -82,11 +87,10 @@ sudo reboot
 }
 
 function nvidia_driver_ {
-if [ ! -f /home/wareck/.pass1 ] && [ ! -f /home/wareck/.pass2 ]
+if [ ! -f /home/wareck/.pass1 ] && [ ! -f /home/wareck/.pass2 ] && [ ! -f /home/wareck/.pass3 ] && [ ! -f /home/wareck/.pass4 ]
+
 then
-echo -e "$(tput setaf 10)\nInstall NVIDIA GT710 Drivers:$(tput sgr0)"
-echo -e "Pré-installation..."
-echo -e "Relancer l'installation après le reboot !!!"
+echo -e "$(tput setaf 10)\nInstall NVIDIA GT710 Drivers phase 1:$(tput sgr0)"
 echo -e ""
 sleep 5
 fi
@@ -106,11 +110,7 @@ fi
 
 if ! [ -f /home/wareck/.pass2 ]
 then
-echo -e "$(tput setaf 10)\nInstall NVIDIA Drivers:$(tput sgr0)"
-echo -e "Pré-installation..."
-echo -e "Relancer l'installation après le reboot !!!"
-echo -e ""
-sleep 3
+sleep 2
 echo -e "$(tput setaf 10)\nInstall NVIDIA GT710 Drivers 470.$Drivers :$(tput sgr0)"
 case $Drivers in
 RAW)
@@ -172,6 +172,8 @@ fi
 }
 
 function download_packs_ {
+if [ ! -f /home/wareck/.pass3 ]
+then
 echo -e "$(tput setaf 10)\nDownload complement packs:$(tput sgr0)"
 wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/cgminer.conf -O /home/wareck/Build_Cube/pack/cgminer.conf
 wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/chia-miner.tar.xz -O /home/wareck/Build_Cube/pack/chia-miner.tar.xz
@@ -185,15 +187,15 @@ cp /home/wareck/Build_Cube/pack/pack2.tar.xz /home/wareck
 cp /home/wareck/Build_Cube/pack/xmrig.tar.xz /home/wareck
 cp /home/wareck/Build_Cube/pack/start_cgminer.tar.xz /home/wareck
 echo "Done."
-if  [ ! -d /home/wareck/webmin-1.990 ]
+if  [ ! -d /home/wareck/webmin-1.991 ]
 then
-cp /home/wareck/Build_Cube/pack/webmin-1.990.tar.xz /home/wareck/
+cp /home/wareck/Build_Cube/pack/webmin-1.991.tar.xz /home/wareck/
 cd /home/wareck/
 echo -e "$(tput setaf 10)\nWebmin uncompress:$(tput sgr0)"
 tar xfJ webmin-1.991.tar.xz --checkpoint=.100
 rm webmin-1.991.tar.xz
-echo "Done."
 echo -n -e "\n"
+echo -e "Done"
 fi
 echo -e "$(tput setaf 10)\nDownloading miners:$(tput sgr0)"
 cd /home/wareck
@@ -216,6 +218,7 @@ if ! [ -d cgminer-gekko ]
 then
 git clone https://github.com/wareck/cgminer-gekko.git
 fi
+fi
 }
 
 function build_miners_ {
@@ -328,6 +331,8 @@ fi
 }
 
 function configure_ {
+if [ ! -f /home/wareck/.pass4 ]
+then
 echo -e "$(tput setaf 10)\nlxPanel sensors:$(tput sgr0)"
 cd /home/wareck
 if ! [ -d sensors-lxpanel-plugin ]
@@ -355,6 +360,7 @@ cd /
 sudo tar xfJ pack2.tar.xz --checkpoint=.10
 echo -n -e "\n"
 cd /home/wareck
+
 #clear
 dynmotd
 
@@ -438,11 +444,27 @@ fi
 sudo chown -R wareck:wareck /home/wareck/xmr*
 sudo chown -R wareck:wareck /home/wareck/cgminer*
 sudo apt-get remove light-locker* -y
+if [ ! -d /home/wareck/.config/lxpanel/LXDE/panels ]
+then
+mkdir /home/wareck/.config/lxpanel/LXDE
+mkdir /home/wareck/.config/lxpanel/LXDE/panels
+fi
 sudo cp /home/wareck/Build_Cube/pack/panel /home/wareck/.config/lxpanel/LXDE/panels/panel
 echo "Done."
+touch /home/wareck/.pass4
+gsettings set org.gnome.shell.extensions.dash-to-dock dash-max-icon-size 32
+sleep 0.5
+gsettings set org.gnome.desktop.background picture-uri /home/wareck/Images/mr-robot-wallpapers.jpg
+sleep 0.5
+#su wareck -c 'gsettings set org.gnome.shell.extensions.dash-to-dock show-mounts false'
+#sleep 0.5
+decompte_
+fi
 }
 
 function printer_ {
+if [ ! -f /home/wareck/.pass3 ]
+then
 if [ ! -d /usr/local/share/foomatic/ ]
 then
 if [ ! -d /tmp/foomatic-db/ ]
@@ -460,9 +482,12 @@ sudo make install
 echo "Done."
 fi
 fi
+fi
 }
 
 function mounting_drives_ {
+if [ ! -f /home/wareck/.pass4 ]
+then
 echo -e "$(tput setaf 10)\nMounting Drives$(tput sgr0)"
 if [ $ZFS = "YES" ]
 then
@@ -480,9 +505,12 @@ sudo chmod 777 /media/Partage
 sudo chmod 777 /media/nvme
 sudo chmod 777 /media/Nas
 echo "Done."
+fi
 }
 
 function cleaning_ {
+if [ -f /home/wareck/.pass4 ]
+then
 echo -e "$(tput setaf 10)\nCleaning:$(tput sgr0)"
 if [ -f /pack2.tar.xz ]; then sudo rm /pack2.tar.xz ;fi
 if [ -f /home/wareck/pack1.tar.xz ]; then rm /home/wareck/pack1.tar.xz ;fi
@@ -497,15 +525,17 @@ if [ -f /home/wareck/NVIDIA-Linux-x86_64-470.82.00.run ]; then rm /home/wareck/N
 if [ -f /home/wareck/.pass1 ]; then rm /home/wareck/.pass1 ;fi
 if [ -f /home/wareck/.pass2 ]; then rm /home/wareck/.pass2 ;fi
 if [ -f /home/wareck/.pass3 ]; then rm /home/wareck/.pass3 ;fi
+if [ -f /home/wareck/.pass4 ]; then rm /home/wareck/.pass4 ;fi
 rm /home/wareck/.config/autostart/install_os.desktop
 rm -r -f /home/wareck/.config/autostart
 echo "Done."
+fi
 }
 
 function autoroot_ {
 if [ ! -d /home/wareck/.config/autostart ]
 then
-echo -e "$(tput setaf 10)\nInit install:$(tput sgr0)"
+echo -e "$(tput setaf 10)\nInit install & autostart :$(tput sgr0)"
 mkdir /home/wareck/.config/autostart
 fi
 if [ ! -f /home/wareck/.config/autostart/install_os.desktop ]
@@ -555,12 +585,8 @@ configure_
 mounting_drives_
 cleaning_
 
-gsettings set org.gnome.shell.extensions.dash-to-dock dash-max-icon-size 32
-sleep 0.5
-gsettings set org.gnome.desktop.background picture-uri /home/wareck/Images/mr-robot-wallpapers.jpg
-sleep 0.5
-#su wareck -c 'gsettings set org.gnome.shell.extensions.dash-to-dock show-mounts false'
-#sleep 0.5
+#clear
+dynmotd
 
 echo -e "$(tput setaf 10)\nEnd of script:$(tput sgr0) \n"
 echo -e "$(tput setaf 7)Need to install webmin manually (reboot required)$(tput sgr0)"