Parcourir la source

update foxypool

Votre Nom il y a 1 an
Parent
commit
4a93cac6d3
2 fichiers modifiés avec 155 ajouts et 118 suppressions
  1. 1 118
      options/chia.sh
  2. 154 0
      options/fox.sh

+ 1 - 118
options/chia.sh

@@ -1,5 +1,5 @@
 #!/bin/bash
-#set -e
+set -e
 Version=6.1.2
 
 Gui=Yes #can be Yes No or Only
@@ -14,9 +14,6 @@ H9_ChiaService=No
 H9_Miner=No
 H9_ChiaProxy=No
 
-FoxyPool=Yes
-FoxyPool_service=Yes
-
 function print_centered {
      [[ $# == 0 ]] && return 1
 
@@ -60,8 +57,6 @@ BladeBit=${BladeBit^^}
 ChiaPos=${ChiaPos^^}
 H9_Miner=${H9_Miner^^}
 H9_ChiaProxy=${H9_ChiaProxy^^}
-FoxyPool=${FoxyPool^^}
-FoxyPool_service=${FoxyPool_service^^}
 
 if [[ "$Gui" ==  "YES" ]] || [[ "$Gui" == "NO" ]] || [[ "$Gui" == "ONLY" ]];then error_flag=$((error_flag+0));else error_flag=$((error_flag+1)) ;fi
 if [[ "$MadMax" ==  "YES" ]] || [[ "$MadMax" = "NO" ]];then error_flag=$((error_flag+0));else error_flag=$((error_flag+1)) ;fi
@@ -72,8 +67,6 @@ if [[ "$ChiaPos" == "YES" ]] || [[ "$ChiaPos" == "NO" ]];then error_flag=$((erro
 if [[ "$H9_ChiaService" == "YES" ]] || [[ "$H9_ChiaService" == "NO" ]];then error_flag=$((error_flag+0));else error_flag=$((error_flag+1));fi
 if [[ "$H9_Miner" == "YES" ]] || [[ "$H9_Miner" == "NO" ]];then error_flag=$((error_flag+0));else error_flag=$((error_flag+1));fi
 if [[ "$H9_ChiaProxy" == "YES" ]] || [[ "$H9_ChiaProxy" == "NO" ]];then error_flag=$((error_flag+0));else error_flag=$((error_flag+1));fi
-if [[ "$FoxyPool" == "YES" ]] || [[ "$FoxyPool" == "NO" ]];then error_flag=$((error_flag+0));else error_flag=$((error_flag+1));fi
-if [[ "$FoxyPool_service" == "YES" ]] || [[ "$FoxyPool_service" == "NO" ]];then error_flag=$((error_flag+0));else error_flag=$((error_flag+1));fi
 }
 
 function intro_ {
@@ -144,13 +137,6 @@ YES)
 	echo -n "$(tput sgr0)"
         ;;
 esac
-case $FoxyPool in
-YES)
-        echo -n "$(tput setaf 44)"
-        print_centered "FoxyPool"
-        echo -n "$(tput sgr0)"
-	;;
-esac
 fi
 sleep 2
 if ! [ -d /home/wareck/chia ];then mkdir /home/wareck/chia;fi
@@ -199,16 +185,6 @@ OUT=/media/Partage/Plots/
 ./chia_plot -p $POOL -f $FARM -n 1 -r 6 -u 128 -t /nvme0/plotting/ -2 /nvme0/plotting/ -d $OUT
 EOF
 chmod +x go.sh
-
-if [ -f foxy.sh ];then rm foxy.sh; fi
-cat <<'EOF'>> foxy.sh
-#!/bin/bash
-POOL=a99e72c49c5ed39bf793caab9e074a80dd61011a859e975842874aab47b783f9ce84282febe2ca275c0930149b67990a
-FARM=8ba5acd276b45fd0f749ce195dcddcf0e63c3bf2e751e9e273faa0125075c36a11f2ee231e7cf74abed2920be97fc373
-OUT=/media/Partage/Plots-nft/
-./chia_plot -p $POOL -f $FARM -n 1 -r 4 -u 128 -t /nvme0/plotting/ -2 /nvme1/plotting/ -d $OUT
-EOF
-chmod +x foxy.sh
 echo -e "\e[97mDone.\e[0m"
 }
 
@@ -236,8 +212,6 @@ for i in {1..5}
 do
 ./bladebit_cuda --no-direct-io -p $POOL -f $FARM -z 7 cudaplot -d 0 --disk-16 -t1 /raid/plotting $OUT
 done
-#sudo reboot
-#/home/wareck/miners/chia-miner/hpool-miner-chia -config /home/wareck/miners/chia-miner/config.yaml
 EOF
 chmod +x cuda.sh
 echo -e "\e[97mDone.\e[0m"
@@ -279,16 +253,6 @@ EOF
 chmod +x ~/go.sh
 cp ~/go.sh ~/chia/chia-gigahorse/cpu-plotter/linux/x86_64/
 rm ~/go.sh
-cat <<'EOF'>> ~/foxypool.sh
-CTR=xch1hsadv5h4c6mvk2av8vg6pdmezu8rapmrsta8z7ds0yd24yt2xshshqrtsy
-FPK=b6d0c62c90338b2dc9c5c2368e4acd1cbf60cadb3b86c0bf58a3706d59b276b49520bf8bfb4e07735fdfb92b03053170
-OUT=/Partage/Plots/
-./cuda_plot_k32 -g 0 -c $CTR -f $FPK -C 17 -n 2 -t /raid/ -3 /raid/ -d $OUT
-ProofOfSpace farm -t 8 -d 100 -f /Partage/Plots/*.plot
-EOF
-chmod +x ~/foxypool.sh
-cp ~/foxypool.sh ~/chia/chia-gigahorse/cuda-plotter/linux/x86_64/foxypool.sh
-rm ~/foxypool.sh
 echo -e "\e[97mDone.\e[0m"
 }
 
@@ -456,87 +420,6 @@ sudo systemctl enable hpool-miner.service
 echo -e "\e[97mDone.\e[0m"
 }
 
-function foxypool_ {
-echo -e "$(tput setaf 10)\nInstall FoxyPool miner :$(tput sgr0)"
-cd /home/wareck/miners
-wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/foxypool.tar.xz
-tar xfJ foxypool.tar.xz --checkpoint=.100
-echo ""
-rm foxypool.tar.xz
-if [ -f /home/wareck/chia/chia-gigahorse/cuda-plotter/linux/x86_64/foxypool.sh ];then rm /home/wareck/chia/chia-gigahorse/cuda-plotter/linux/x86_64/foxypool.sh;fi
-cat <<'EOF'>> foxypool.sh
-#!/bin/bash
-CTR=xch1hsadv5h4c6mvk2av8vg6pdmezu8rapmrsta8z7ds0yd24yt2xshshqrtsy
-FPK=b6d0c62c90338b2dc9c5c2368e4acd1cbf60cadb3b86c0bf58a3706d59b276b49520bf8bfb4e07735fdfb92b03053170
-OUT=/Partage/Plots/
-./cuda_plot_k32 -g 0 -c $CTR -f $FPK -C 17 -n 2 -t /raid/ -3 /raid/ -d $OUT
-ProofOfSpace farm -t 8 -d 100 -f /Partage/Plots/*.plot
-EOF
-chmod +x foxypool.sh
-mv foxypool.sh /home/wareck/chia/chia-gigahorse/cuda-plotter/linux/x86_64/foxypool.sh
-}
-
-function foxypool_service_ {
-echo -e "$(tput setaf 10)\nInstall FoxyPool service :$(tput sgr0)"
-cat > $HOME/foxypool.service << EOF
-# The foxypool service (part of systemd)
-# file: /etc/systemd/system/foxypool.service
-
-[Unit]
-Description     = Foxypool Service
-After=network.target
-
-[Service]
-Type=simple
-User            = $USER
-WorkingDirectory= $HOME/miners/foxy-gh-farmer
-ExecStart       = $HOME/miners/foxy-gh-farmer/foxy-gh-farmer -c $HOME/miners/foxy-gh-farmer/foxy-gh-farmer.yaml
-Restart         = on-failure
-RestartSec=30
-LimitNOFILE=99999
-StandardOutput=syslog
-StandardError=syslog
-SyslogIdentifier=foxypool
-
-
-[Install]
-WantedBy    = multi-user.target
-EOF
-sudo mv $HOME/foxypool.service /etc/systemd/system/foxypool.service  >/dev/null
-sudo chmod 644 /etc/systemd/system/foxypool.service
-
-cat <<'EOF'>> foxypool.conf
-if $programname == 'flexfarmer' then /var/log/foxypool.log
-& stop
-EOF
-sudo cp foxypool.conf /etc/rsyslog.d/foxypool.conf
-sudo rm foxypool.conf
-if [ ! -f /var/log/foxypool.log ]
-then
-sudo touch /var/log/foxypool.log
-sudo chown syslog:adm /var/log/foxypool.log
-fi
-cat <<'EOF'>> logrot
-/var/log/foxypool.log {
-    daily
-    rotate 7
-    copytruncate
-    notifempty
-    missingok
-    su root syslog
-}
-EOF
-sudo cp logrot /etc/logrotate.d/foxypool
-sudo rm logrot
-
-sudo systemctl restart rsyslog >/dev/null 2>&1
-sudo systemctl daemon-reload >/dev/null 2>&1
-sudo systemctl enable foxypool >/dev/null 2>&1
-sudo systemctl start foxypool >/dev/null 2>&1
-
-echo -e "\e[97mDone.\e[0m"
-}
-
 function cmake_ {
 if [ $BladeBit = "YES" ]
 then

+ 154 - 0
options/fox.sh

@@ -0,0 +1,154 @@
+#!/bin/bash
+FoxyPool_service=Yes
+FoxyPool_service=${FoxyPool_service^^}
+
+if [ -f /tmp/latest ]; then rm /tmp/latest ; fi
+curl -s https://api.github.com/repos/foxypool/foxy-gh-farmer/releases/latest > /tmp/latest
+VERSION=$(cat /tmp/latest | grep "tag_name" | awk {'print$2'} | tr -d \",)
+URL=$(cat /tmp//latest |grep "browser_download_url.*ubuntu.zip" |  cut -d : -f 2,3 | tr -d \")
+
+if [[ "$FoxyPool_service" == "YES" ]] || [[ "$FoxyPool_service" == "NO" ]];then error_flag=$((error_flag+0));else error_flag=$((error_flag+1));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
+}
+
+
+
+export TERM=xterm-256color
+print_centered "$(tput setaf 130)"
+print_centered " _____                         _ "
+print_centered "|   __|___ _ _ _ _ ___ ___ ___| |"
+print_centered "|   __| . |_'_| | | . | . | . | |"
+print_centered "|__|  |___|_,_|_  |  _|___|___|_|"
+print_centered "              |___|_|            "
+print_centered ""
+echo -n "$(tput sgr0)"
+print_centered "Version $VERSION"
+
+if [ $error_flag -ne 0 ]
+then
+        echo -n "$(tput setaf 1 ;tput bold)"
+        print_centered "Config Error !!!"
+        echo -n "$(tput sgr0)"
+        exit 0
+fi
+case $FoxyPool_service in
+YES)
+        echo -n "$(tput setaf 44)"
+        print_centered "FoxyPool Service Enabled"
+        echo -n "$(tput sgr0)"
+        ;;
+esac
+echo -e "\n"
+
+
+if [ ! -d ~/miners/foxypool ]
+then
+mkdir ~/miners/foxypool
+fi
+
+echo -e "$(tput setaf 10)\nInstall Foxy-gh-Farmer:$(tput sgr0)"
+cd ~/miners/foxypool
+wget -q $URL
+unzip -q -o foxy-gh-farmer-ubuntu.zip
+rm foxy-gh-farmer-ubuntu.zip
+echo -e "\e[97mDone.\e[0m"
+
+function foxypool_service_ {
+echo -e "$(tput setaf 10)\nInstall FoxyPool service :$(tput sgr0)"
+cat > $HOME/foxypool.service << EOF
+# The foxypool service (part of systemd)
+# file: /etc/systemd/system/foxypool.service
+
+[Unit]
+Description     = Foxypool Service
+After=network.target
+
+[Service]
+Type=simple
+User            = $USER
+WorkingDirectory= $HOME/miners/foxy-gh-farmer
+ExecStart       = $HOME/miners/foxy-gh-farmer/foxy-gh-farmer -c $HOME/miners/foxy-gh-farmer/foxy-gh-farmer.yaml
+Restart         = on-failure
+RestartSec=30
+LimitNOFILE=99999
+StandardOutput=syslog
+StandardError=syslog
+SyslogIdentifier=foxypool
+
+
+[Install]
+WantedBy    = multi-user.target
+EOF
+sudo mv $HOME/foxypool.service /etc/systemd/system/foxypool.service  >/dev/null
+sudo chmod 644 /etc/systemd/system/foxypool.service
+
+cat <<'EOF'>> foxypool.conf
+if $programname == 'flexfarmer' then /var/log/foxypool.log
+& stop
+EOF
+sudo cp foxypool.conf /etc/rsyslog.d/foxypool.conf
+sudo rm foxypool.conf
+if [ ! -f /var/log/foxypool.log ]
+then
+sudo touch /var/log/foxypool.log
+sudo chown syslog:adm /var/log/foxypool.log
+fi
+cat <<'EOF'>> logrot
+/var/log/foxypool.log {
+    daily
+    rotate 7
+    copytruncate
+    notifempty
+    missingok
+    su root syslog
+}
+EOF
+sudo cp logrot /etc/logrotate.d/foxypool
+sudo rm logrot
+
+sudo systemctl restart rsyslog >/dev/null 2>&1
+sudo systemctl daemon-reload >/dev/null 2>&1
+sudo systemctl enable foxypool >/dev/null 2>&1
+sudo systemctl start foxypool >/dev/null 2>&1
+
+echo -e "\e[97mDone.\e[0m"
+}
+
+function bashing {
+cat <<'EOF'>> ~/foxypool.sh
+CTR=xch1hsadv5h4c6mvk2av8vg6pdmezu8rapmrsta8z7ds0yd24yt2xshshqrtsy
+FPK=b6d0c62c90338b2dc9c5c2368e4acd1cbf60cadb3b86c0bf58a3706d59b276b49520bf8bfb4e07735fdfb92b03053170
+OUT=/Partage/Plots/
+./cuda_plot_k32 -g 0 -c $CTR -f $FPK -C 17 -n 2 -t /raid/ -3 /raid/ -d $OUT
+ProofOfSpace farm -t 8 -d 100 -f /Partage/Plots/*.plot
+EOF
+chmod +x ~/foxypool.sh
+cp ~/foxypool.sh ~/chia/chia-gigahorse/cuda-plotter/linux/x86_64/foxypool.sh
+rm ~/foxypool.sh
+}
+
+if [ $FoxyPool_service = "YES" ]; then foxypool_service_;fi
+rm /tmp/latest
+bashing