|
@@ -1,11 +1,19 @@
|
|
#!/bin/bash
|
|
#!/bin/bash
|
|
-echo -e "Linux config v2.2 wareck@gmail.com"
|
|
|
|
|
|
+function choice {
|
|
|
|
+if ! [ -f /home/wareck/.pass1 ]
|
|
|
|
+then
|
|
|
|
+echo -e "Linux backup/miner config v3.0 "
|
|
echo -e ""
|
|
echo -e ""
|
|
|
|
+if [ -f ~/b10.conf ]; then rm ~/b10.conf ; fi
|
|
PS3='Please enter your choice: '
|
|
PS3='Please enter your choice: '
|
|
-options=("NVIDIA-RTX" "NVIDIA-GTX" "AMD" "Quit")
|
|
|
|
|
|
+options=("NVIDIA-RTX-LHR" "NVIDIA-RTX" "NVIDIA-GTX" "AMD" "Quit")
|
|
select opt in "${options[@]}"
|
|
select opt in "${options[@]}"
|
|
do
|
|
do
|
|
case $opt in
|
|
case $opt in
|
|
|
|
+ "NVIDIA-RTX-LHR")
|
|
|
|
+ Mode="NVIDIALHR"
|
|
|
|
+ break
|
|
|
|
+ ;;
|
|
"NVIDIA-RTX")
|
|
"NVIDIA-RTX")
|
|
Mode="NVIDIARTX"
|
|
Mode="NVIDIARTX"
|
|
break
|
|
break
|
|
@@ -19,41 +27,50 @@ do
|
|
break
|
|
break
|
|
;;
|
|
;;
|
|
"Quit")
|
|
"Quit")
|
|
- break
|
|
|
|
|
|
+ exit
|
|
|
|
+ break
|
|
;;
|
|
;;
|
|
*) echo "invalid option $REPLY";;
|
|
*) echo "invalid option $REPLY";;
|
|
esac
|
|
esac
|
|
done
|
|
done
|
|
|
|
+cat <<'EOF'>> ~/b10.conf
|
|
|
|
+Mode=XXX
|
|
|
|
+EOF
|
|
|
|
+sed -i "s/XXX/$Mode/g" ~/b10.conf
|
|
|
|
+touch ~/.pass1
|
|
|
|
+fi
|
|
|
|
+echo -e ""
|
|
|
|
+}
|
|
|
|
|
|
function update_one {
|
|
function update_one {
|
|
|
|
+if ! [ -f /home/wareck/.pass2 ]
|
|
|
|
+then
|
|
sudo timedatectl set-local-rtc 1 --adjust-system-clock
|
|
sudo timedatectl set-local-rtc 1 --adjust-system-clock
|
|
sudo apt-get update -y
|
|
sudo apt-get update -y
|
|
sudo apt-get upgrade -y
|
|
sudo apt-get upgrade -y
|
|
sudo apt-get dist-upgrade -y
|
|
sudo apt-get dist-upgrade -y
|
|
sudo apt-get install htop python3-pip openssh-server screen wakeonlan -y
|
|
sudo apt-get install htop python3-pip openssh-server screen wakeonlan -y
|
|
-cp miners.tar.xz /home/wareck/
|
|
|
|
-cp wallpaper.tar.xz /home/wareck/
|
|
|
|
-cp hashcat.tar.xz /home/wareck/
|
|
|
|
|
|
+wget -c http://folivier.homelinux.org/cube/pack/gpu-miners.tar.xz
|
|
|
|
+cp ~/backup_users_win10/build/miners.tar.xz /home/wareck/
|
|
|
|
+cp ~/backup_users_win10/build/wallpaper.tar.xz /home/wareck/
|
|
|
|
+cp ~/backup_users_win10/build/hashcat.tar.xz /home/wareck/
|
|
cd /home/wareck/
|
|
cd /home/wareck/
|
|
tar xvfJ wallpaper.tar.xz
|
|
tar xvfJ wallpaper.tar.xz
|
|
sudo rm wallpaper.tar.xz
|
|
sudo rm wallpaper.tar.xz
|
|
|
|
+touch ~/.pass2
|
|
|
|
+fi
|
|
|
|
+echo -n ""
|
|
}
|
|
}
|
|
|
|
|
|
function update_two {
|
|
function update_two {
|
|
if [ $Mode = "NVIDIAGTX" ]
|
|
if [ $Mode = "NVIDIAGTX" ]
|
|
then
|
|
then
|
|
-sudo apt-get install nvidia-cuda-toolkit nvidia-cuda-dev nvidia-driver-470 -y
|
|
|
|
|
|
+sudo apt install nvidia-cuda-toolkit nvidia-cuda-dev nvidia-driver-470 -y
|
|
fi
|
|
fi
|
|
if [ $Mode = "NVIDIARTX" ]
|
|
if [ $Mode = "NVIDIARTX" ]
|
|
then
|
|
then
|
|
-sudo apt-get install nvidia-cuda-toolkit nvidia-cuda-dev nvidia-driver-510 -y
|
|
|
|
|
|
+sudo apt install nvidia-cuda-toolkit nvidia-cuda-dev nvidia-driver-510 -y
|
|
fi
|
|
fi
|
|
-
|
|
|
|
-sudo apt-get install samba cifs-utils mdadm git build-essential libtool pkg-config automake autoconf ethtool net-tools openvpn filezilla libuv1-dev libuvc-dev cmake git nmap -y
|
|
|
|
-sudo apt-get install gcc-8 g++-8 mesa-utils libmicrohttpd-dev libcurl4-openssl-dev lvm2 llvm-dev gparted msr-tools nasm btrfs-progs -y
|
|
|
|
-sudo apt-get install libssl-dev p7zip-full -y
|
|
|
|
-sudo apt autoremove -y
|
|
|
|
-
|
|
|
|
if [ $Mode = "AMD" ]
|
|
if [ $Mode = "AMD" ]
|
|
then
|
|
then
|
|
cd /home/wareck
|
|
cd /home/wareck
|
|
@@ -67,9 +84,13 @@ sudo rm -r -f /home/wareck/linux-firmware /home/wareck/linux-firmware.tar.xz
|
|
sudo apt-get install /home/wareck/Build_Cube/pack/amdgpu-install_22.10.2.50102-1_all.deb -y
|
|
sudo apt-get install /home/wareck/Build_Cube/pack/amdgpu-install_22.10.2.50102-1_all.deb -y
|
|
sudo apt-get update
|
|
sudo apt-get update
|
|
sudo amdgpu-install --opencl=legacy --accept-eula -y
|
|
sudo amdgpu-install --opencl=legacy --accept-eula -y
|
|
-sudo apt-get install ocl-icd-opencl-dev -y
|
|
|
|
|
|
+sudo apt install ocl-icd-opencl-dev -y
|
|
sudo apt install build-essential cmake git libuv1-dev libssl-dev libhwloc-dev libmicrohttpd-dev lm-sensors htop clinfo -y
|
|
sudo apt install build-essential cmake git libuv1-dev libssl-dev libhwloc-dev libmicrohttpd-dev lm-sensors htop clinfo -y
|
|
fi
|
|
fi
|
|
|
|
+sudo apt install samba cifs-utils mdadm git build-essential libtool pkg-config automake autoconf ethtool net-tools openvpn filezilla libuv1-dev libuvc-dev cmake git nmap -y
|
|
|
|
+sudo apt install gcc-8 g++-8 mesa-utils libmicrohttpd-dev libcurl4-openssl-dev lvm2 llvm-dev gparted msr-tools nasm btrfs-progs -y
|
|
|
|
+sudo apt install libssl-dev p7zip-full -y
|
|
|
|
+sudo apt autoremove -y
|
|
}
|
|
}
|
|
|
|
|
|
function build_miner {
|
|
function build_miner {
|
|
@@ -81,7 +102,7 @@ echo ""
|
|
git clone https://github.com/tpruvot/ccminer.git && echo ""
|
|
git clone https://github.com/tpruvot/ccminer.git && echo ""
|
|
git clone https://github.com/tpruvot/cpuminer-multi.git && echo ""
|
|
git clone https://github.com/tpruvot/cpuminer-multi.git && echo ""
|
|
git clone https://github.com/xmrig/xmrig.git && echo ""
|
|
git clone https://github.com/xmrig/xmrig.git && echo ""
|
|
-if [ $Mode = "NVIDIAGTX" ] || [ $Mode = "NVIDIARTX" ]
|
|
|
|
|
|
+if [ $Mode = "NVIDIAGTX" ] || [ $Mode = "NVIDIARTX" ] || [ $Mode = "NVIDIALHR" ]
|
|
then
|
|
then
|
|
git clone https://github.com/xmrig/xmrig-nvidia.git && echo ""
|
|
git clone https://github.com/xmrig/xmrig-nvidia.git && echo ""
|
|
fi
|
|
fi
|
|
@@ -110,7 +131,7 @@ cd build
|
|
cmake ..
|
|
cmake ..
|
|
make -j$(nproc)
|
|
make -j$(nproc)
|
|
cd ~/miners
|
|
cd ~/miners
|
|
-if [ $Mode = "NVIDIAGTX" ] || [ $Mode = "NVIDIARTX" ]
|
|
|
|
|
|
+if [ $Mode = "NVIDIAGTX" ] || [ $Mode = "NVIDIARTX" ] || [ $Mode = "NVIDIALHR" ]
|
|
then
|
|
then
|
|
cd xmrig-nvidia
|
|
cd xmrig-nvidia
|
|
cd build
|
|
cd build
|
|
@@ -161,7 +182,7 @@ sudo mv wakeup_cube.sh /usr/local/bin
|
|
}
|
|
}
|
|
|
|
|
|
function liquidcontrol {
|
|
function liquidcontrol {
|
|
-if [ $Mode = "NVIDIAGTX" ] || [ $Mode = "NVIDIARTX" ]
|
|
|
|
|
|
+if [ $Mode = "NVIDIAGTX" ] || [ $Mode = "NVIDIARTX" ] || [ $Mode = "NVIDIALHR" ]
|
|
then
|
|
then
|
|
sudo pip3 install liquidctl
|
|
sudo pip3 install liquidctl
|
|
fi
|
|
fi
|
|
@@ -215,7 +236,7 @@ sudo rm zap2
|
|
bash -c /usr/local/bin/zap
|
|
bash -c /usr/local/bin/zap
|
|
fi
|
|
fi
|
|
|
|
|
|
-if [ $Mode = "NVIDIARTX" ]
|
|
|
|
|
|
+if [ $Mode = "NVIDIARTX" ] || [ $Mode = "NVIDIALHR" ]
|
|
then
|
|
then
|
|
cat <<'EOF'>> liquidcfg.service
|
|
cat <<'EOF'>> liquidcfg.service
|
|
[Unit]
|
|
[Unit]
|
|
@@ -262,7 +283,15 @@ print_centered "▐█▀▀█▄█▌▐█▌▐█·██▪ ▐█· ▐
|
|
print_centered "██▄▪▐█▐█▄█▌▐█▌▐█▌▐▌██. ██ ▐█▄▄▌▐█•█▌"
|
|
print_centered "██▄▪▐█▐█▄█▌▐█▌▐█▌▐▌██. ██ ▐█▄▄▌▐█•█▌"
|
|
print_centered "·▀▀▀▀ ▀▀▀ ▀▀▀.▀▀▀ ▀▀▀▀▀• ▀▀▀ .▀ ▀"
|
|
print_centered "·▀▀▀▀ ▀▀▀ ▀▀▀.▀▀▀ ▀▀▀▀▀• ▀▀▀ .▀ ▀"
|
|
print_centered "$(tput setaf 7)$(tput bold)"
|
|
print_centered "$(tput setaf 7)$(tput bold)"
|
|
-print_centered "Autoconfig Ubuntu pour le backup des Users"
|
|
|
|
|
|
+#print_centered "Autoconfig Ubuntu pour le backup des Users"
|
|
|
|
+if [ -z $Mode ];then source ~/b10.conf;fi
|
|
|
|
+if [ $Mode = "NVIDIALHR" ]
|
|
|
|
+then
|
|
|
|
+print_centered "NVIDIA-RTX + NZXT + windows 10"
|
|
|
|
+echo -n "$(tput setaf 9)$(tput blink)"
|
|
|
|
+print_centered "LHR mining"
|
|
|
|
+echo -n "$(tput setaf 7)$(tput sgr0)"
|
|
|
|
+fi
|
|
if [ $Mode = "NVIDIAGTX" ]
|
|
if [ $Mode = "NVIDIAGTX" ]
|
|
then
|
|
then
|
|
print_centered "NVIDIA-GTX + NZXT + windows 10"
|
|
print_centered "NVIDIA-GTX + NZXT + windows 10"
|
|
@@ -276,7 +305,7 @@ then
|
|
print_centered "AMD RX580 + windows 10"
|
|
print_centered "AMD RX580 + windows 10"
|
|
fi
|
|
fi
|
|
echo "$(tput setaf 7)"
|
|
echo "$(tput setaf 7)"
|
|
-sleep 4
|
|
|
|
|
|
+sleep 3
|
|
}
|
|
}
|
|
|
|
|
|
function print_centered {
|
|
function print_centered {
|
|
@@ -323,10 +352,94 @@ function outro {
|
|
print_centered "$(tput setaf 3)$(tput bold)"
|
|
print_centered "$(tput setaf 3)$(tput bold)"
|
|
print_centered "Système pret, reboot recommandé !"
|
|
print_centered "Système pret, reboot recommandé !"
|
|
echo "$(tput setaf 7)"
|
|
echo "$(tput setaf 7)"
|
|
-touch /home/wareck/.pass1
|
|
|
|
|
|
+rm ~/.config/autostart/build.desktop
|
|
|
|
+rm ~/LHR1
|
|
|
|
+rm ~/LHR2
|
|
|
|
+rm ~/.pass1
|
|
|
|
+rm ~/.pass2
|
|
|
|
+rm ~/NVIDIA-Linux-x86_64-470.129.06.run
|
|
|
|
+if grep "/home/wareck/backup_users_win10/build/build_linux.sh" ~/.bashrc >/dev/null
|
|
|
|
+then
|
|
|
|
+sed -i '$ d' /home/wareck/.bashrc
|
|
|
|
+fi
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+function autorunme {
|
|
|
|
+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."
|
|
|
|
+fi
|
|
|
|
+
|
|
|
|
+if [ ! -f /home/wareck/.config/autostart/build.desktop ]
|
|
|
|
+then
|
|
|
|
+cat <<'EOF'>> /home/wareck/.config/autostart/build.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 "/home/wareck/backup_users_win10/build/build_linux.sh"
|
|
|
|
+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/build.desktop
|
|
|
|
+fi
|
|
|
|
+
|
|
|
|
+if ! grep "build_linux.sh" ~/.bashrc >/dev/null
|
|
|
|
+ then
|
|
|
|
+ echo "/home/wareck/backup_users_win10/build/build_linux.sh" >> ~/.bashrc
|
|
|
|
+fi
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function LHR {
|
|
|
|
+if [ ! -f ~/LHR1 ]
|
|
|
|
+then
|
|
|
|
+echo -e "Installation driver NVIDIA-470 LHR:"
|
|
|
|
+cd ~/
|
|
|
|
+wget -c -q --show-progress http://wareck.free.fr/genethos/NVIDIA-Linux-x86_64-470.129.06.run
|
|
|
|
+chmod +x ~/NVIDIA-Linux-x86_64-470.129.06.run
|
|
|
|
+touch ~/LHR1
|
|
|
|
+sudo systemctl isolate multi-user.target
|
|
|
|
+fi
|
|
|
|
+
|
|
|
|
+if [ -f ~/LHR1 ]
|
|
|
|
+then
|
|
|
|
+sudo modprobe -r nvidia-drm
|
|
|
|
+cd ~
|
|
|
|
+sudo ./NVIDIA-Linux-x86_64-470.129.06.run -a
|
|
|
|
+touch ~/LHR2
|
|
|
|
+if grep "/home/wareck/backup_users_win10/build/build_linux.sh" ~/.bashrc >/dev/null
|
|
|
|
+then
|
|
|
|
+sed -i '$ d' /home/wareck/.bashrc
|
|
|
|
+fi
|
|
|
|
+sudo systemctl start graphical.target
|
|
|
|
+fi
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+choice
|
|
intro
|
|
intro
|
|
|
|
+if [ $Mode = "NVIDIALHR" ]
|
|
|
|
+ then
|
|
|
|
+ autorunme
|
|
|
|
+if [ ! -f ~/LHR2 ];then LHR ;fi
|
|
|
|
+fi
|
|
update_one
|
|
update_one
|
|
liquidcontrol
|
|
liquidcontrol
|
|
sleep 1
|
|
sleep 1
|