Votre Nom il y a 8 mois
Parent
commit
c0d0b2178b
2 fichiers modifiés avec 763 ajouts et 2 suppressions
  1. 761 0
      edge.sh
  2. 2 2
      options/chia.sh

+ 761 - 0
edge.sh

@@ -0,0 +1,761 @@
+#!/bin/bash
+set -e
+Version=18.4.1
+Cuda=YES
+kernel_custom=YES
+Miners=Yes
+Webmin="webmin-2.105"
+driver=NVIDIA
+
+if (( $EUID != 0 )); then
+   echo -e "$(tput setaf 11)This must be run as root. Try 'sudo $0'.$(tput sgr0)"
+   exit 1
+fi
+clear
+if [ ! -f /home/wareck/.ipass ]
+then
+echo "passe=1" > /home/wareck/.ipass
+fi
+source /home/wareck/.ipass
+
+
+export TERM=xterm-256color
+Cuda=${Cuda^^}
+kernel_custom=${kernel_custom^^}
+driver=${driver^^}
+Miners=${Miners^^}
+cpass=""
+function ubuntu_version_check {
+if [[ $(lsb_release -rs) == "20.04" ]]
+then
+
+      Ubuntu_version="20.04.6"
+
+else
+       echo "Non-compatible version !"
+       exit 0
+fi
+}
+
+function print_centered {
+     [[ $# == 0 ]] && return 1
+
+     declare -i TERM_COLS="$(tput cols)"
+     declare -i str_len="${#1}"
+     [[ $str_len -ge $TERM_COLS ]] && {
+          echo "$1";
+          return 0;
+     }
+
+     declare -i filler_len="$(( (TERM_COLS - str_len) / 2 ))"
+     [[ $# -ge 2 ]] && ch="${2:0:1}" || ch=" "
+     filler=""
+     for (( i = 0; i < filler_len; i++ )); do
+          filler="${filler}${ch}"
+     done
+
+     printf "%s%s%s" "$filler" "$1" "$filler"
+     [[ $(( (TERM_COLS - str_len) % 2 )) -ne 0 ]] && printf "%s" "${ch}"
+     printf "\n"
+
+     return 0
+}
+
+function decompte_ {
+echo -e "$(tput setaf 10)\nReboot in 10 seconds (CRTL+C to abord):$(tput sgr0)"
+for i in {9..0}
+do
+echo -e -n "$i "
+sleep 1
+done
+echo ""
+sudo reboot
+}
+
+function intro_ {
+print_centered "$(tput setaf 5)"
+print_centered "███████╗██████╗  ██████╗ ███████╗"
+print_centered "██╔════╝██╔══██╗██╔════╝ ██╔════╝"
+print_centered "█████╗  ██║  ██║██║  ███╗█████╗  "
+print_centered "██╔══╝  ██║  ██║██║   ██║██╔══╝  "
+print_centered "███████╗██████╔╝╚██████╔╝███████╗"
+print_centered "╚══════╝╚═════╝  ╚═════╝ ╚══════╝"
+print_centered "                                 "
+echo -n "$(tput sgr0)"
+print_centered "Edge Server installation script v$Version"
+print_centered "Ubuntu version 20.04.6"
+if [ $Cuda = "YES" ]
+then
+print_centered "CUDA Compute Drivers"
+fi
+print_centered "Stage $passe/4"
+}
+
+function update_ {
+case $passe in
+1)
+   echo -e "$(tput setaf 10)\nUpdate and install packages (second pass):$(tput sgr0)"
+   sudo apt-get update
+   echo -e ""
+   sudo apt-get install lxde lxde-icon-theme -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 xfsprogs -y
+   echo -e ""
+   sudo apt-get install zstd pixz pbzip2 pigz btrfs-progs gparted gpart gnome-remote-desktop libcanberra-gtk-module \
+   ctorrent libcurl4-openssl-dev bison byacc screen libudev-dev libjansson-dev libncurses5-dev libmicrohttpd-dev curl nvme-cli -y
+   echo -e ""
+   sudo apt-get install libglib2.0-dev libgtk2.0-dev libsensors4-dev htop vlc locate cmake -y
+   echo -e "Done."
+   ;;
+2)
+   if [ $Cuda = "YES" ]
+   then
+   echo -e "$(tput setaf 10)\nInstall Cuda packages:$(tput sgr0)"
+   sudo apt-get install libgmp-dev libnuma-dev cmake libuv1-dev nvidia-cuda-dev libmicrohttpd-dev gcc-8 g++-8 nvidia-cuda-toolkit -y
+   fi
+   echo -e "Done.\n"
+   ;;
+esac
+}
+
+function kernel_check_ {
+unamestr=$(uname -r)
+if ! [[ "$unamestr" == "5.15.152-custom" ]]
+then
+echo -e "\n$(tput setaf 10)Custom kernel install $(tput setaf 9)5.15.152-custom(tput setaf 10) (fix DKMS/WOL) :$(tput sgr0)"
+cd /tmp/
+wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/custom_kernel/
+kernel_5.15.152-custom-edge.run
+chmod +x kernel_5.15.152-custom-edge.run
+sudo ./kernel_5.15.152-custom-edge.run
+if ! [ -f /etc/modprobe.d/blacklist-nvidia-nouveau.conf ]
+then
+echo "Blacklist nvidia-nouveau driver..."
+echo "System will reboot"
+sudo bash -c "echo blacklist nouveau > /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
+sudo bash -c "echo options nouveau modeset=0 >> /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
+fi
+fi
+}
+
+function nvidia_driver_ {
+if [ $passe = "1" ]
+then
+	if ! [ -f /etc/modprobe.d/blacklist-nvidia-nouveau.conf ]
+	then
+        echo "Blacklist nvidia-nouveau driver..."
+        echo "System will reboot"
+        sudo bash -c "echo blacklist nouveau > /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
+        sudo bash -c "echo options nouveau modeset=0 >> /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
+	fi
+	if [ $Cuda = "NO" ]
+	then
+	sudo apt-get install build-essential libglvnd-dev cmake -y
+	else
+	sudo apt-get install build-essential libglvnd-dev cmake libhugetlbfs-dev libc-dev libc6-dev g++ -y
+	fi
+	echo "passe=2" > /home/wareck/.ipass
+	decompte_
+fi
+if [ $passe = "2" ]
+then
+case $Cuda in
+NO)
+	echo -e "$(tput setaf 10)\nInstall NVIDIA GTX1080 Drivers :$(tput sgr0)"
+	sleep 3
+	sudo apt-get install nvidia-driver-525 -y
+	touch /home/wareck/.pass2
+	decompte_
+	;;
+YES)
+	echo -e "$(tput setaf 10)\nInstall CUDA Drivers :$(tput sgr0)"
+	cd /home/wareck/
+	echo -e "Download MegaDownload:"
+	git clone https://github.com/wareck/megadown.git
+	sudo cp /home/wareck/megadown/megadown /usr/local/bin/megadown
+	sudo rm -r /home/wareck/megadown
+	wget https://developer.download.nvidia.com/compute/cuda/12.4.0/local_installers/cuda_12.4.0_550.54.14_linux.run
+	chmod +x cuda_12.4.0_550.54.14_linux.run
+	sudo ./cuda_12.4.0_550.54.14_linux.run --silent --driver --toolkit
+	sudo rm cuda_12.4.0_550.54.14_linux.run
+	echo "passe=3" > /home/wareck/.ipass
+	decompte_
+;;
+esac
+fi
+}
+
+function download_packs_ {
+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
+wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/gerbera.tar.xz -O /home/wareck/Build_Cube/pack/gerbera.tar.xz
+wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/start_cgminer.tar.xz -O /home/wareck/Build_Cube/pack/start_cgminer.tar.xz
+wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/$Webmin.tar.xz -O /home/wareck/Build_Cube/pack/$Webmin.tar.xz
+wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/xmrig.tar.xz -O /home/wareck/Build_Cube/pack/xmrig.tar.xz
+wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/zfsmanager-0.0.4.wbm.gz -O /home/wareck/Build_Cube/pack/zfsmanager-0.0.4.wbm.gz
+wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/gpu-miners.tar.xz -O /home/wareck/Build_Cube/pack/gpu-miners.tar.xz
+
+cp /home/wareck/Build_Cube/pack/gpu-miners.tar.xz /home/wareck
+cp /home/wareck/Build_Cube/pack/pack1.tar.xz /home/wareck
+cp /home/wareck/Build_Cube/pack/pack2.tar.xz /home/wareck
+cp /home/wareck/Build_Cube/pack/pack3.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 -e "Done."
+
+if  [ ! -d /home/wareck/$Webmin ]
+then
+cp /home/wareck/Build_Cube/pack/$Webmin.tar.xz /home/wareck/
+cd /home/wareck/
+echo -e "$(tput setaf 10)\nWebmin uncompress:$(tput sgr0)"
+tar xfJ $Webmin.tar.xz
+rm $Webmin.tar.xz
+echo -e "Done"
+fi
+
+echo -e "$(tput setaf 10)\nDownloading miners:$(tput sgr0)"
+cd /home/wareck
+if ! [ -d miners ]; then mkdir -p miners;fi
+cd /home/wareck/miners
+
+if ! [ -d xmrig ]
+then
+git clone https://github.com/xmrig/xmrig.git
+echo -e ""
+fi
+echo -e "Done.\n"
+}
+
+function build_miners_ {
+cmake_ #check cmake version
+cd /home/wareck
+tar xfJ gpu-miners.tar.xz
+cd /home/wareck/miners
+
+echo -e "$(tput setaf 10)\nUncompress xmr files:$(tput sgr0)"
+tar xfJ /home/wareck/xmrig.tar.xz --checkpoint=.100
+echo "Done."
+echo -n -e "\n"
+echo -e "$(tput setaf 10)\nBuild xmrig:$(tput sgr0)"
+
+cd xmrig
+git config --global --add safe.directory /home/wareck/miners/xmrig
+git pull
+sed -i "s/kDefaultDonateLevel = 5;/kDefaultDonateLevel = 0;/g" src/donate.h
+sed -i "s/kMinimumDonateLevel = 1;/kMinimumDonateLevel = 0;/g" src/donate.h
+cd scripts
+./build_deps.sh
+cd ..
+cd build
+cmake .. -DXMRIG_DEPS=scripts/deps
+make -j$((`nproc`))
+cd ..
+echo "Done."
+
+#Reduce mode
+if [ -d /home/wareck/miners/xmrig-upx ];then rm -r /home/wareck/miners/xmrig-upx;fi
+if [ -d /home/wareck/miners/xmr-stak ];then rm -r /home/wareck/miners/xmr-stak;fi
+if [ -d /home/wareck/miners/xmr-stak-rx ];then rm -r /home/wareck/miners/xmr-stak-rx;fi
+sudo chmod -R 775 /home/wareck/miners
+}
+
+function configure_ {
+echo -e "$(tput setaf 10)\nlxPanel sensors:$(tput sgr0)"
+cd /home/wareck
+if ! [ -d sensors-lxpanel-plugin ]
+then
+git clone https://github.com/danamlund/sensors-lxpanel-plugin.git
+fi
+cd /home/wareck
+cd sensors-lxpanel-plugin
+make
+sudo make install
+sudo rm -r /home/wareck/sensors-lxpanel-plugin
+echo "Done."
+
+echo -e "$(tput setaf 10)\nConfig files:$(tput sgr0)"
+cd /home/wareck/
+zip="['firefox.desktop', 'thunderbird.desktop', 'org.remmina.Remmina.desktop', 'filezilla.desktop', 'org.gnome.Nautilus.desktop', 'org.gnome.Terminal.desktop']"
+cat <<'EOF'>> zap
+#!/bin/bash
+gsettings set org.gnome.shell.extensions.dash-to-dock dash-max-icon-size 32
+gsettings set org.gnome.desktop.background picture-uri /home/wareck/Images/mr-robot-wallpapers.jpg
+gsettings set org.gnome.shell favorite-apps "XXX"
+#su wareck -c 'gsettings set org.gnome.shell.extensions.dash-to-dock show-mounts false'
+dconf load /org/gnome/terminal/ < /usr/local/bin/zap2
+EOF
+sed -i "s/XXX/$zip/g" zap
+
+UUID=$(gsettings get org.gnome.Terminal.ProfilesList default | tr -d \')
+cat <<'EOF'>> zap2
+[legacy/profiles:/:XXX]
+default-size-columns=110
+font='Monospace 9'
+use-system-font=false
+use-theme-colors=false
+EOF
+sed -i "s/XXX/$UUID/g" zap2
+chmod +x zap
+sudo cp zap /usr/local/bin
+sudo cp zap2 /usr/local/bin
+sudo rm zap
+sudo rm zap2
+sleep 1
+
+sudo rm -r -f /etc/update-motd.d/*
+tar xfJ pack1.tar.xz --checkpoint=.10
+echo -n -e "\n"
+sudo cp /home/wareck/pack2.tar.xz /
+sudo cp /home/wareck/pack3.tar.xz /
+cd /
+sudo tar xfJ pack2.tar.xz --checkpoint=.10
+sudo tar xfJ pack3.tar.xz --checkpoint=.10
+echo -n -e "\n"
+cd /home/wareck
+
+sudo sed -i -e "s/# set constantshow/set constantshow/g" /etc/nanorc
+
+if ! grep "wareck" /etc/sudoers >/dev/null
+then
+sudo sh -c "echo \"wareck ALL=(ALL) NOPASSWD: ALL\" >> /etc/sudoers"
+fi
+
+echo -e "$(tput setaf 10)\nBuild folder and mount drives:$(tput sgr0)"
+if ! [ -r /store ];then sudo mkdir /store;fi
+if ! [ -r /raid ];then sudo mkdir /raid;fi
+if ! grep "UUID=1df72b63-fca0-45c6-992c-3e2532d5591a /media/Store ext4" /etc/fstab >/dev/null
+then
+cp /etc/fstab /tmp/fstab
+cat <<"EOF">> /tmp/fstab
+#ext4
+#UUID=1df72b63-fca0-45c6-992c-3e2532d5591a /media/Store ext4 auto,nofail,noatime,rw,user    0   0
+#btrfs temporary drives
+#/dev/md0 /raid btrfs ssd,nodatasum,nobarrier,nodatacow,discard=async,noatime 0 0
+#Chia drive
+EOF
+sudo cp /tmp/fstab /etc/fstab
+fi
+
+sudo rm /etc/hosts
+sudo cat <<'EOF'>> /etc/hosts
+127.0.0.1       localhost
+127.0.1.1       poweredge
+192.168.1.8     miniserver miniserver gogserver.dnsalias.com
+192.168.1.10    nzxt
+192.168.1.11    garage
+192.168.1.100   cube
+192.168.1.254   mafreebox.freebox.fr
+192.168.1.200   node
+
+# The following lines are desirable for IPv6 capable hosts
+::1     ip6-localhost ip6-loopback
+fe00::0 ip6-localnet
+ff00::0 ip6-mcastprefix
+ff02::1 ip6-allnodes
+ff02::2 ip6-allrouters
+EOF
+echo "Done."
+
+echo -e "$(tput setaf 10)\nSensors drivers:$(tput sgr0)"
+if ! grep "it87" /etc/modules >/dev/null
+then
+cp /etc/modules /tmp/modules
+cat <<"EOF">> /tmp/modules
+
+# Chip drivers
+it87
+EOF
+sudo cp /tmp/modules /etc/modules
+fi
+if [ -f /tmp/sensors3.conf ]
+then
+chmod 777 /tmp/sensors3.conf
+rm /tmp/sensors3.conf
+fi
+cat <<'EOF'>> /tmp/sensors3.conf
+chip "it8728-isa-0228"
+label  in0  "Vcore"
+label  in1  "Vdram"    # "DDR3" in BIOS
+label  in2  "+3.3V"
+label  in3  "+5V"      # Not in BIOS
+label  in4  "+12V"
+ignore in5             # -12V unused
+ignore in6
+label  in7  "5VSB"     # Not in BIOS
+label  in8  "Vbat"     # Not in BIOS
+compute  in3  @ * (6.8/10+1), @ / (6.8/10+1)
+compute  in4  @ * 3.963,      @ / 3.963
+compute  in7  @ * (6.8/10+1), @ / (6.8/10+1)
+set in0_min  0.825 * 0.95
+set in0_max  1.425 * 1.05
+set in1_min  1.5   * 0.95
+set in1_max  1.5   * 1.05
+set in2_min  3.3   * 0.95
+set in2_max  3.3   * 1.05
+set in3_min  5     * 0.95
+set in3_max  5     * 1.05
+set in4_min 12     * 0.95
+set in4_max 12     * 1.05
+set in7_min  5     * 0.95
+set in7_max  5     * 1.05
+ignore cpu0_vid
+set fan4_min 100
+set fan1_min 100
+ignore fan2
+ignore fan3
+ignore fan5
+ignore in8
+ignore intrusion0
+label fan1 "fan1"
+label fan4 "fan2"
+label temp1 "MB"
+label temp2 "CPU"
+set temp2_min 0
+set temp2_max 75
+set temp1_min 0
+set temp1_max 90
+set temp1_beep 0.0
+label temp1 "VRM Temp"
+set   temp1_min 0
+set   temp1_max 65
+label temp2  "SB Temp"
+label temp3 "CPU Temp"
+set   temp3_min 0
+set   temp3_max 65
+
+chip "nvme-pci-0400"
+set temp2_max 75
+set temp2_min 20
+set temp3_max 75
+set temp3_min 20
+EOF
+
+chmod 644 /tmp/sensors3.conf
+sudo cp /tmp/sensors3.conf /etc/
+sudo sensors -s
+sensors
+
+sudo apt install ethtool -y
+iface=$(ip link | awk -F: '$0 !~ "lo|vir|^[^0-9]"{printf $2a}' | cut -d ' ' -f2)
+sudo ethtool --change $iface wol g
+
+cat <<'EOF'>> /tmp/wakemeup.sh
+#!/bin/bash
+set -e
+if ! [ -x "$(command -v etherwake)" ];then sudo apt-get install etherwake -y;fi
+clear
+echo -e "$(tput setaf 10)Wake On Lan v1.0:$(tput sgr0)"
+PS3="Select : "
+items=("Nzxt" "Garage" "Blade")
+
+select item in "${items[@]}" Quit
+    do
+        case $REPLY in
+            1) sudo etherwake -i enp5s0 E0:D5:5E:2D:9E:CB ; break;;
+            2) sudo etherwake -i enp5s0 58:11:22:CD:FC:7A ; break;;
+            3) sudo etherwake -i enp5s0 78:AC:44:57:3C:50 ; break;;
+            $((${#items[@]}+1))) echo "We're done!"; break 2;;
+            *) echo "Ooops - unknown choice $REPLY"; break;
+        esac
+    done
+echo -e ""
+EOF
+sudo chmod +x /tmp/wakemeup.sh
+sudo cp /tmp/wakemeup.sh /usr/local/bin
+echo "Done."
+
+echo -e "$(tput setaf 10)\nVnc init:$(tput sgr0)"
+sudo update-rc.d vncserver defaults
+echo "Done."
+
+echo -e "$(tput setaf 10)\nOpening ports:$(tput sgr0)"
+sudo ufw allow 8333 >/dev/null
+sudo ufw allow 22 >/dev/null
+sudo ufw allow 5900 >/dev/null
+sudo ufw allow 10000 >/dev/null
+sudo ufw allow 139 >/dev/null
+sudo ufw allow 5901 >/dev/null
+sudo ufw allow 5902 >/dev/null
+sudo ufw allow 445 >/dev/null
+sudo ufw allow 1337 >/dev/null
+sudo ufw allow 1447 >/dev/null
+echo "Done."
+
+echo -e "$(tput setaf 10)\nBashrc mod:$(tput sgr0)"
+if [ $Cuda = "YES" ]
+then
+if ! grep "#mod for cuda" /home/wareck/.bashrc >/dev/null
+then
+echo '#mod for cuda' >>/home/wareck/.bashrc
+echo 'export PATH=/usr/local/cuda-12.3/bin/:$PATH'>>/home/wareck/.bashrc
+echo 'export LD_LIBRARY_PATH=/usr/local/cuda-12.3/lib64:$LD_LIBRARY_PATH'>>/home/wareck/.bashrc
+echo '' >>/home/wareck/.bashrc
+fi
+fi
+if ! grep "#mod for tightvncserver" /home/wareck/.bashrc >/dev/null
+then
+echo '#mod for tightvncserver' >>/home/wareck/.bashrc
+echo 'cd ~' >>/home/wareck/.bashrc
+fi
+echo "Done."
+
+echo -e "$(tput setaf 10)\nDisable IPv6:$(tput sgr0)"
+if ! grep "ipv6.disable=1" /etc/default/grub >/dev/null
+then
+sed -i -e "s/quiet splash/quiet splash ipv6.disable=1/g" /etc/default/grub
+sed -i -e "s/GRUB_CMDLINE_LINUX=\"/GRUB_CMDLINE_LINUX=\"ipv6.disable=1 acpi_enforce_resources=lax/g" /etc/default/grub
+sudo update-grub2
+fi
+sudo chown -R wareck:wareck /home/wareck/miners/xmr*
+sudo chown -R wareck:wareck /home/wareck/miners/cgminer*
+sudo apt-get remove light-locker* -y
+if [ ! -d /home/wareck/.config/lxpanel/LXDE/panels ]
+then
+mkdir /home/wareck/.config/lxpanel
+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
+sudo chmod 777 /home/wareck/.config/lxpanel/LXDE/panels/panel
+if [ ! -d  /home/wareck/.config/lxterminal ]
+then
+mkdir /home/wareck/.config/lxterminal
+fi
+sudo cp /home/wareck/Build_Cube/pack/lxterminal.conf /home/wareck/.config/lxterminal/
+sudo chmod 777 /home/wareck/.config/lxterminal/lxterminal.conf
+echo "Done."
+echo "passe=4" >/home/wareck/.ipass
+decompte_
+}
+
+function printer_ {
+if [ ! -d /usr/local/share/foomatic/ ]
+then
+if [ ! -d /tmp/foomatic-db/ ]
+then
+cd /tmp/
+echo -e "$(tput setaf 10)\nInstall printers generic drivers:$(tput sgr0)"
+git clone https://github.com/OpenPrinting/foomatic-db.git
+fi
+cd /tmp/foomatic-db
+if [ ! -d /usr/local/share/foomatic/ ]
+then
+./make_configure
+./configure
+sudo make install
+echo "Done."
+fi
+fi
+}
+
+function mounting_drives_ {
+echo -e "$(tput setaf 10)\nMounting Drives$(tput sgr0)"
+if ! findmnt /media/store >/dev/null ; then sudo mount /media/Store ;fi
+sudo chmod 777 /media/store
+sudo chmod 777 /raid
+echo "Done."
+}
+
+function cleaning_ {
+echo -e "$(tput setaf 10)\nCleaning install files:$(tput sgr0)"
+if [ -f /pack2.tar.xz ]; then sudo rm /pack2.tar.xz ;fi
+if [ -f /pack3.tar.xz ]; then sudo rm /pack3.tar.xz ;fi
+if [ -f /home/wareck/pack1.tar.xz ]; then rm /home/wareck/pack1.tar.xz ;fi
+if [ -f /home/wareck/pack2.tar.xz ]; then rm /home/wareck/pack2.tar.xz ;fi
+if [ -f /home/wareck/pack3.tar.xz ]; then rm /home/wareck/pack3.tar.xz ;fi
+if [ -f /home/wareck/xmrig.tar.xz ]; then rm /home/wareck/xmrig.tar.xz ;fi
+if [ -f /home/wareck/gpu-miners.tar.xz ]; then rm /home/wareck/gpu-miners.tar.xz;fi
+if [ -r /home/wareck/Music ]; then sudo rm -r -f /home/wareck/Music ;fi
+if [ -r /home/wareck/Public ]; then sudo rm -r -f /home/wareck/Public ;fi
+if [ -r /home/wareck/Templates ]; then sudo rm -r -f /home/wareck/Templates ;fi
+if [ -r /home/wareck/Vidéos ]; then sudo rm -r -f /home/wareck/Vidéos ;fi
+if [ -f /home/wareck/NVIDIA-Linux-x86_64-470.74.run ]; then rm /home/wareck/NVIDIA-Linux-x86_64-470.74.run ;fi
+if [ -f /home/wareck/NVIDIA-Linux-x86_64-470.82.00.run ]; then rm /home/wareck/NVIDIA-Linux-x86_64-470.82.00.run ;fi
+if [ -f /home/wareck/.ipass ]; then rm /home/wareck/.ipass ;fi
+if [ -f /usr/local/bin/zap ]; then sudo rm /usr/local/bin/zap* ;fi
+if [ -f /home/wareck/.config/autostart/install_os.desktop ];then sudo rm /home/wareck/.config/autostart/install_os.desktop;fi
+if [ -f /home/wareck/.config/autostart/zappy.desktop ];then sudo rm /home/wareck/.config/autostart/zappy.desktop;fi
+if [ -r /lib/modules/5.15.0-60-generic ]; then sudo rm -r /lib/modules/5.15.0-60-generic ;fi
+if [ -r /lib/modules/5.15.0-46-generic ]; then sudo rm -r /lib/modules/5.15.0-46-generic ;fi
+if [ -r /lib/modules/5.15.0-70-generic ]; then sudo rm -r /lib/modules/5.15.0-70-generic ;fi
+cd /home/wareck/Build_Cube/pack
+sudo chown -R wareck:wareck /home/wareck/miners
+sudo chmod -R 775 /home/wareck/miners
+./clean.sh
+echo -e "Done. \n"
+
+echo `date` "install/update" >/home/wareck/.buildcube
+sudo apt-get autoremove -y
+sleep 1
+}
+
+function autoroot_ {
+if ! grep "#color putty" ~/.bashrc >/dev/null
+then
+echo "#color putty" >> ~/.bashrc
+echo "export TERM=xterm-256color" >> ~/.bashrc
+fi
+if [ ! -d /home/wareck/.config/autostart ]
+then
+echo -e "$(tput setaf 10)\nInit install & autostart:$(tput sgr0)"
+mkdir /home/wareck/.config/autostart
+echo -e "Done."
+sleep 1
+fi
+
+if [ ! -f /home/wareck/.config/autostart/install_os.desktop ]
+then
+cat <<'EOF'>> /home/wareck/.config/autostart/install_os.desktop
+[Desktop Entry]
+# VERSION=3.36.2
+Name=Terminal
+Comment=Use the command line
+Keywords=shell;prompt;command;commandline;cmd;
+TryExec=gnome-terminal
+Exec=gnome-terminal -- bash -c "sudo /home/wareck/Build_Cube/edge.sh; exec bash"
+Icon=org.gnome.Terminal
+Type=Application
+Categories=GNOME;GTK;System;TerminalEmulator;
+StartupNotify=true
+X-GNOME-SingleWindow=false
+OnlyShowIn=GNOME;Unity;
+Actions=new-window;preferences;
+X-Ubuntu-Gettext-Domain=gnome-terminal
+
+[Desktop Action new-window]
+Name=New Window
+Exec=gnome-terminal --window
+
+[Desktop Action preferences]
+Name=Preferences
+Exec=gnome-terminal --preferences
+EOF
+chmod +x /home/wareck/.config/autostart/install_os.desktop
+fi
+
+if [ ! -f /home/wareck/.config/autostart/zappy.desktop ]
+then
+cat <<'EOF'>> /home/wareck/.config/autostart/zappy.desktop
+[Desktop Entry]
+# VERSION=3.36.2
+Name=Terminal
+Comment=Use the command line
+Keywords=shell;prompt;command;commandline;cmd;
+TryExec=gnome-terminal
+Exec=gnome-terminal -- bash -c "/usr/local/bin/zap"
+Icon=org.gnome.Terminal
+Type=Application
+Categories=GNOME;GTK;System;TerminalEmulator;
+StartupNotify=true
+X-GNOME-SingleWindow=false
+OnlyShowIn=GNOME;Unity;
+Actions=new-window;preferences;
+X-Ubuntu-Gettext-Domain=gnome-terminal
+
+[Desktop Action new-window]
+Name=New Window
+Exec=gnome-terminal --window
+
+[Desktop Action preferences]
+Name=Preferences
+Exec=gnome-terminal --preferences
+EOF
+chmod +x /home/wareck/.config/autostart/zappy.desktop
+fi
+if ! grep "wareck" /etc/sudoers >/dev/null
+then
+sudo sh -c "echo \"wareck ALL=(ALL) NOPASSWD: ALL\" >> /etc/sudoers"
+fi
+if [ $passe="2" ]
+then
+echo -e "$(tput setaf 10)\nUpdate and install packages:$(tput sgr0)"
+sudo apt-get update
+sudo apt-get install lxde lxde-icon-theme -y
+sleep 1
+fi
+}
+
+function remove_screensaver {
+#remove screensaver
+cat <<EOF>> autostart
+@lxpanel --profile LXDE
+@pcmanfm --desktop --profile LXDE
+EOF
+sudo chmod 744 autostart
+sudo cp autostart /etc/xdg/lxsession/LXDE/
+sudo cp autostart /home/wareck/.config/lxsession/LXDE/
+sudo rm autostart
+sudo apt-get remove xscreensaver xscreensaver-data -y
+}
+
+function cmake_ {
+pids=""
+/home/wareck/Build_Cube/options/tools/_cmake.sh rollback & pids="$pids $!"
+wait $pids
+sudo ldconfig
+}
+
+function watchdog_ {
+pids=""
+/home/wareck/Build_Cube/options/watchdog.sh ext & pids="$pids $!"
+wait $pids
+}
+
+function wol_ {
+iface=$(ip link | awk -F: '$0 !~ "lo|vir|^[^0-9]"{printf $2a}' | cut -d ' ' -f2)
+ether=$(which ethtool)
+echo "[Unit]" >>/tmp/wol.service
+echo "Description=Enable Wake On Lan" >>/tmp/wol.service
+echo "" >>/tmp/wol.service
+echo "[Service]" >>/tmp/wol.service
+echo "Type=oneshot" >>/tmp/wol.service
+echo "ExecStart = $ether --change $iface wol g" >>/tmp/wol.service
+echo "" >>/tmp/wol.service
+echo "[Install]" >>/tmp/wol.service
+echo "WantedBy=basic.target" >>/tmp/wol.service
+sudo cp /tmp/wol.service /etc/systemd/system/wol.service
+sudo systemctl daemon-reload >/dev/null
+sudo systemctl enable wol.service >/dev/null
+sudo systemctl start wol.service >/dev/null
+sleep 2
+clear
+}
+
+intro_
+case $passe in
+1)
+  watchdog_
+  autoroot_
+  ubuntu_version_check
+  update_
+  kernel_check_
+  nvidia_driver_
+  ;;
+2)
+  nvidia_driver_
+  update_
+  ;;
+3)
+  download_packs_
+  printer_
+  build_miners_
+  configure_
+  ;;
+4)
+  mounting_drives_
+  cleaning_
+  remove_screensaver
+  clear
+  wol_
+  dynmotd
+  ;;
+*) ;;
+esac
+
+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)"
+echo -e "$(tput setaf 7)after install webmin, reboot is required $(tput sgr0)"
+echo -e ""
+

+ 2 - 2
options/chia.sh

@@ -146,8 +146,8 @@ function GigaHorse_farmer_ {
 echo -e "$(tput setaf 10)\nInstall GigaHorse Farmer$(tput sgr0)"
 if ! [ -d /home/wareck/blockchain ];then mkdir /home/wareck/blockchain;fi
 cd /home/wareck/blockchain/
-NAME=$(curl -s https://api.github.com/repos/madMAx43v3r/chia-gigahorse/releases/latest | grep ".*x86_64.tar.gz" | grep "name" | awk {'print$2'} | cut -d : -f 2,3 | tr -d \",)
-curl -s https://api.github.com/repos/madMAx43v3r/chia-gigahorse/releases/latest | grep "browser_download_url.*x86_64.tar.gz" | cut -d : -f 2,3 | tr -d \" | wget -q --show-progress -i -
+NAME=$(curl -s https://api.github.com/repos/madMAx43v3r/chia-gigahorse/releases/latest | grep ".*x86_64.tar.gz" | grep "name" | awk {'print$2'} | cut -d : -f 2,3 | tr -d \",| grep -v "h100")
+curl -s https://api.github.com/repos/madMAx43v3r/chia-gigahorse/releases/latest | grep "browser_download_url.*-x86_64.tar.gz" | cut -d : -f 2,3 | tr -d \" |grep -v "h100"| wget -q --show-progress -i -
 tar xfz $NAME --checkpoint=.1000
 rm $NAME
 echo -e "\n\e[97mDone.\e[0m"