|
@@ -1,10 +1,9 @@
|
|
#!/bin/bash
|
|
#!/bin/bash
|
|
set -e
|
|
set -e
|
|
-Version=18.4.1
|
|
|
|
|
|
+Version=18.4.2
|
|
Cuda=YES
|
|
Cuda=YES
|
|
kernel_custom=YES
|
|
kernel_custom=YES
|
|
Miners=Yes
|
|
Miners=Yes
|
|
-Webmin="webmin-2.105"
|
|
|
|
driver=NVIDIA
|
|
driver=NVIDIA
|
|
|
|
|
|
if (( $EUID != 0 )); then
|
|
if (( $EUID != 0 )); then
|
|
@@ -84,7 +83,7 @@ print_centered "╚█████╔╝╚██████╔╝██║
|
|
print_centered " ╚════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝"
|
|
print_centered " ╚════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝"
|
|
print_centered " "
|
|
print_centered " "
|
|
echo -n "$(tput sgr0)"
|
|
echo -n "$(tput sgr0)"
|
|
-print_centered "Edge Server installation script v$Version"
|
|
|
|
|
|
+print_centered "Edge Server script v$Version"
|
|
print_centered "Ubuntu version 20.04.6"
|
|
print_centered "Ubuntu version 20.04.6"
|
|
if [ $Cuda = "YES" ]
|
|
if [ $Cuda = "YES" ]
|
|
then
|
|
then
|
|
@@ -99,15 +98,13 @@ case $passe in
|
|
echo -e "$(tput setaf 10)\nUpdate and install packages (second pass):$(tput sgr0)"
|
|
echo -e "$(tput setaf 10)\nUpdate and install packages (second pass):$(tput sgr0)"
|
|
sudo apt-get update
|
|
sudo apt-get update
|
|
echo -e ""
|
|
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
|
|
|
|
|
|
+ sudo apt-get install cifs-utils mdadm git build-essential libtool pkg-config automake autoconf ethtool net-tools \
|
|
|
|
+ tasksel lzma-dev lzma cmake libuv1-dev libssl-dev openssh-server xfsprogs -y
|
|
echo -e ""
|
|
echo -e ""
|
|
sudo apt-get install zstd pixz pbzip2 pigz btrfs-progs gparted gpart gnome-remote-desktop libcanberra-gtk-module \
|
|
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
|
|
|
|
|
|
+ bison byacc screen curl nvme-cli -y
|
|
echo -e ""
|
|
echo -e ""
|
|
- sudo apt-get install libglib2.0-dev libgtk2.0-dev libsensors4-dev htop vlc locate cmake -y
|
|
|
|
|
|
+ sudo apt-get install libglib2.0-dev locate cmake -y
|
|
echo -e "Done."
|
|
echo -e "Done."
|
|
;;
|
|
;;
|
|
2)
|
|
2)
|
|
@@ -123,13 +120,13 @@ esac
|
|
|
|
|
|
function kernel_check_ {
|
|
function kernel_check_ {
|
|
unamestr=$(uname -r)
|
|
unamestr=$(uname -r)
|
|
-if ! [[ "$unamestr" == "5.15.152-jupiter" ]]
|
|
|
|
|
|
+if ! [[ "$unamestr" == "5.15.159-jupiter" ]]
|
|
then
|
|
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)"
|
|
|
|
|
|
+echo -e "\n$(tput setaf 10)Custom kernel install $(tput setaf 9)5.15.159-custom(tput setaf 10) (fix DKMS/WOL) :$(tput sgr0)"
|
|
cd /tmp/
|
|
cd /tmp/
|
|
-wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/custom_kernel/kernel_5.15.152-jupiter.run
|
|
|
|
-chmod +x kernel_5.15.152-jupiter.run
|
|
|
|
-sudo ./kernel_5.15.152-jupiter.run
|
|
|
|
|
|
+wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/custom_kernel/kernel_5.15.159-jupiter.run
|
|
|
|
+chmod +x kernel_5.15.159-jupiter.run
|
|
|
|
+sudo ./kernel_5.15.159-jupiter.run
|
|
if ! [ -f /etc/modprobe.d/blacklist-nvidia-nouveau.conf ]
|
|
if ! [ -f /etc/modprobe.d/blacklist-nvidia-nouveau.conf ]
|
|
then
|
|
then
|
|
echo "Blacklist nvidia-nouveau driver..."
|
|
echo "Blacklist nvidia-nouveau driver..."
|
|
@@ -176,10 +173,10 @@ YES)
|
|
git clone https://github.com/wareck/megadown.git
|
|
git clone https://github.com/wareck/megadown.git
|
|
sudo cp /home/wareck/megadown/megadown /usr/local/bin/megadown
|
|
sudo cp /home/wareck/megadown/megadown /usr/local/bin/megadown
|
|
sudo rm -r /home/wareck/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
|
|
|
|
|
|
+ wget -c https://developer.download.nvidia.com/compute/cuda/12.4.1/local_installers/cuda_12.4.1_550.54.15_linux.run
|
|
|
|
+ chmod +x cuda_12.4.1_550.54.15_linux.run
|
|
|
|
+ sudo ./cuda_12.4.1_550.54.15_linux.run --silent --driver --toolkit
|
|
|
|
+ sudo rm cuda_12.4.1_550.54.15_linux.run
|
|
echo "passe=3" > /home/wareck/.ipass
|
|
echo "passe=3" > /home/wareck/.ipass
|
|
decompte_
|
|
decompte_
|
|
;;
|
|
;;
|
|
@@ -190,10 +187,8 @@ fi
|
|
function download_packs_ {
|
|
function download_packs_ {
|
|
echo -e "$(tput setaf 10)\nDownload complement packs:$(tput sgr0)"
|
|
echo -e "$(tput setaf 10)\nDownload complement packs:$(tput sgr0)"
|
|
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/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/$Webmin.tar.xz -O /home/wareck/Build_Cube/pack/$Webmin.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/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
|
|
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/gpu-miners.tar.xz /home/wareck
|
|
@@ -266,7 +261,7 @@ zip="['firefox.desktop', 'thunderbird.desktop', 'org.remmina.Remmina.desktop', '
|
|
cat <<'EOF'>> zap
|
|
cat <<'EOF'>> zap
|
|
#!/bin/bash
|
|
#!/bin/bash
|
|
gsettings set org.gnome.shell.extensions.dash-to-dock dash-max-icon-size 32
|
|
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.desktop.background picture-uri /home/wareck/Images/mad-max-wallpapers.jpg
|
|
gsettings set org.gnome.shell favorite-apps "XXX"
|
|
gsettings set org.gnome.shell favorite-apps "XXX"
|
|
#su wareck -c 'gsettings set org.gnome.shell.extensions.dash-to-dock show-mounts false'
|
|
#su wareck -c 'gsettings set org.gnome.shell.extensions.dash-to-dock show-mounts false'
|
|
dconf load /org/gnome/terminal/ < /usr/local/bin/zap2
|
|
dconf load /org/gnome/terminal/ < /usr/local/bin/zap2
|
|
@@ -276,10 +271,14 @@ sed -i "s/XXX/$zip/g" zap
|
|
UUID=$(gsettings get org.gnome.Terminal.ProfilesList default | tr -d \')
|
|
UUID=$(gsettings get org.gnome.Terminal.ProfilesList default | tr -d \')
|
|
cat <<'EOF'>> zap2
|
|
cat <<'EOF'>> zap2
|
|
[legacy/profiles:/:XXX]
|
|
[legacy/profiles:/:XXX]
|
|
-default-size-columns=110
|
|
|
|
-font='Monospace 9'
|
|
|
|
|
|
+background-transparency-percent=7
|
|
|
|
+font='Monospace 8'
|
|
use-system-font=false
|
|
use-system-font=false
|
|
use-theme-colors=false
|
|
use-theme-colors=false
|
|
|
|
+use-theme-transparency=false
|
|
|
|
+use-transparent-background=true
|
|
|
|
+background-transparency-percent=7
|
|
|
|
+default-size-columns=110
|
|
EOF
|
|
EOF
|
|
sed -i "s/XXX/$UUID/g" zap2
|
|
sed -i "s/XXX/$UUID/g" zap2
|
|
chmod +x zap
|
|
chmod +x zap
|
|
@@ -308,21 +307,19 @@ sudo sh -c "echo \"wareck ALL=(ALL) NOPASSWD: ALL\" >> /etc/sudoers"
|
|
fi
|
|
fi
|
|
|
|
|
|
echo -e "$(tput setaf 10)\nBuild folder and mount drives:$(tput sgr0)"
|
|
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
|
|
|
|
|
|
+if ! [ -r /raid ]
|
|
|
|
+then
|
|
|
|
+sudo mkdir /raid
|
|
|
|
+fi
|
|
|
|
+
|
|
|
|
+if ! grep "#/swapfile" /etc/fstab >/dev/null
|
|
then
|
|
then
|
|
cp /etc/fstab /tmp/fstab
|
|
cp /etc/fstab /tmp/fstab
|
|
-cat <<"EOF">> /tmp/fstab
|
|
|
|
-#ext4
|
|
|
|
-UUID=e5089cbd-e278-4d87-a8b8-7555cc291ea4 /store ext4 auto,nofail,noatime,rw,user 0 0
|
|
|
|
-#raid temporary drives
|
|
|
|
-#/dev/md0 /raid btrfs ssd,nodatasum,nobarrier,nodatacow,discard=async,noatime 0 0
|
|
|
|
-#Chia drive
|
|
|
|
-EOF
|
|
|
|
|
|
+sed -i '/ swap / s/^\(.*\)$/#\1/g' /tmp/fstab
|
|
sudo cp /tmp/fstab /etc/fstab
|
|
sudo cp /tmp/fstab /etc/fstab
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
+
|
|
sudo rm /etc/hosts
|
|
sudo rm /etc/hosts
|
|
sudo cat <<'EOF'>> /etc/hosts
|
|
sudo cat <<'EOF'>> /etc/hosts
|
|
127.0.0.1 localhost
|
|
127.0.0.1 localhost
|
|
@@ -343,10 +340,6 @@ ff02::2 ip6-allrouters
|
|
EOF
|
|
EOF
|
|
echo "Done."
|
|
echo "Done."
|
|
|
|
|
|
-echo -e "$(tput setaf 10)\nSensors drivers:$(tput sgr0)"
|
|
|
|
-sensors
|
|
|
|
-echo "Done."
|
|
|
|
-
|
|
|
|
echo -e "$(tput setaf 10)\nW.O.L drivers:$(tput sgr0)"
|
|
echo -e "$(tput setaf 10)\nW.O.L drivers:$(tput sgr0)"
|
|
sudo apt install ethtool -y
|
|
sudo apt install ethtool -y
|
|
iface=$(ip link | awk -F: '$0 !~ "lo|vir|^[^0-9]"{printf $2a}' | cut -d ' ' -f2)
|
|
iface=$(ip link | awk -F: '$0 !~ "lo|vir|^[^0-9]"{printf $2a}' | cut -d ' ' -f2)
|
|
@@ -359,14 +352,14 @@ if ! [ -x "$(command -v etherwake)" ];then sudo apt-get install etherwake -y;fi
|
|
clear
|
|
clear
|
|
echo -e "$(tput setaf 10)Wake On Lan v1.0:$(tput sgr0)"
|
|
echo -e "$(tput setaf 10)Wake On Lan v1.0:$(tput sgr0)"
|
|
PS3="Select : "
|
|
PS3="Select : "
|
|
-items=("Nzxt" "Garage" "Blade")
|
|
|
|
|
|
+items=("Nzxt" "Garage" "Cube")
|
|
|
|
|
|
select item in "${items[@]}" Quit
|
|
select item in "${items[@]}" Quit
|
|
do
|
|
do
|
|
case $REPLY in
|
|
case $REPLY in
|
|
- 1) sudo etherwake -i enp5s0 E0:D5:5E:2D:9E:CB ; break;;
|
|
|
|
|
|
+ 1) sudo etherwake -i enp5s0 98:03:CF:07:31:72 ; break;;
|
|
2) sudo etherwake -i enp5s0 58:11:22:CD:FC:7A ; 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;;
|
|
|
|
|
|
+ 3) sudo etherwake -i enp5s0 94:DE:80:2F:83:43 ; break;;
|
|
$((${#items[@]}+1))) echo "We're done!"; break 2;;
|
|
$((${#items[@]}+1))) echo "We're done!"; break 2;;
|
|
*) echo "Ooops - unknown choice $REPLY"; break;
|
|
*) echo "Ooops - unknown choice $REPLY"; break;
|
|
esac
|
|
esac
|
|
@@ -377,10 +370,6 @@ sudo chmod +x /tmp/wakemeup.sh
|
|
sudo cp /tmp/wakemeup.sh /usr/local/bin
|
|
sudo cp /tmp/wakemeup.sh /usr/local/bin
|
|
echo "Done."
|
|
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)"
|
|
echo -e "$(tput setaf 10)\nOpening ports:$(tput sgr0)"
|
|
sudo ufw allow 8333 >/dev/null
|
|
sudo ufw allow 8333 >/dev/null
|
|
sudo ufw allow 22 >/dev/null
|
|
sudo ufw allow 22 >/dev/null
|
|
@@ -405,12 +394,6 @@ echo 'export LD_LIBRARY_PATH=/usr/local/cuda-12.4/lib64:$LD_LIBRARY_PATH'>>/home
|
|
echo '' >>/home/wareck/.bashrc
|
|
echo '' >>/home/wareck/.bashrc
|
|
fi
|
|
fi
|
|
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)"
|
|
echo -e "$(tput setaf 10)\nDisable IPv6:$(tput sgr0)"
|
|
if ! grep "ipv6.disable=1" /etc/default/grub >/dev/null
|
|
if ! grep "ipv6.disable=1" /etc/default/grub >/dev/null
|
|
@@ -440,31 +423,11 @@ echo "passe=4" >/home/wareck/.ipass
|
|
decompte_
|
|
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_ {
|
|
function mounting_drives_ {
|
|
echo -e "$(tput setaf 10)\nMounting Drives$(tput sgr0)"
|
|
echo -e "$(tput setaf 10)\nMounting Drives$(tput sgr0)"
|
|
#if ! findmnt /store >/dev/null ; then sudo mount /store |null ;fi
|
|
#if ! findmnt /store >/dev/null ; then sudo mount /store |null ;fi
|
|
#sudo chmod 777 /store
|
|
#sudo chmod 777 /store
|
|
-#sudo chmod 777 /raid
|
|
|
|
|
|
+sudo chmod 777 /raid
|
|
echo "Done."
|
|
echo "Done."
|
|
}
|
|
}
|
|
|
|
|
|
@@ -523,7 +486,7 @@ Name=Terminal
|
|
Comment=Use the command line
|
|
Comment=Use the command line
|
|
Keywords=shell;prompt;command;commandline;cmd;
|
|
Keywords=shell;prompt;command;commandline;cmd;
|
|
TryExec=gnome-terminal
|
|
TryExec=gnome-terminal
|
|
-Exec=gnome-terminal -- bash -c "sudo /home/wareck/Build_Cube/edge.sh; exec bash"
|
|
|
|
|
|
+Exec=gnome-terminal -- bash -c "sudo /home/wareck/Build_Cube/jupiter.sh; exec bash"
|
|
Icon=org.gnome.Terminal
|
|
Icon=org.gnome.Terminal
|
|
Type=Application
|
|
Type=Application
|
|
Categories=GNOME;GTK;System;TerminalEmulator;
|
|
Categories=GNOME;GTK;System;TerminalEmulator;
|
|
@@ -581,7 +544,6 @@ if [ $passe="2" ]
|
|
then
|
|
then
|
|
echo -e "$(tput setaf 10)\nUpdate and install packages:$(tput sgr0)"
|
|
echo -e "$(tput setaf 10)\nUpdate and install packages:$(tput sgr0)"
|
|
sudo apt-get update
|
|
sudo apt-get update
|
|
-sudo apt-get install lxde lxde-icon-theme -y
|
|
|
|
sleep 1
|
|
sleep 1
|
|
fi
|
|
fi
|
|
}
|
|
}
|
|
@@ -667,7 +629,6 @@ case $passe in
|
|
;;
|
|
;;
|
|
3)
|
|
3)
|
|
download_packs_
|
|
download_packs_
|
|
- printer_
|
|
|
|
build_miners_
|
|
build_miners_
|
|
configure_
|
|
configure_
|
|
;;
|
|
;;
|