Full Code of ccminerproxy/CC-MinerProxy for AI

master 4b97b3518bd5 cached
19 files
16.4 MB
106.2k tokens
1 requests
Download .txt
Showing preview only (388K chars total). Download the full file or copy to clipboard to get everything.
Repository: ccminerproxy/CC-MinerProxy
Branch: master
Commit: 4b97b3518bd5
Files: 19
Total size: 16.4 MB

Directory structure:
gitextract_ud7r_ff7/

├── LICENSE
├── README.md
├── linux/
│   ├── README.md
│   ├── ccminertaxproxy
│   ├── cer.pem
│   ├── config.json
│   ├── gost
│   ├── html/
│   │   ├── index-no-tax.html
│   │   ├── index.html
│   │   └── login.html
│   ├── install.sh
│   └── key.pem
└── windows/
    ├── README.md
    ├── cer.pem
    ├── config.json
    ├── html/
    │   ├── index-no-tax.html
    │   ├── index.html
    │   └── login.html
    └── key.pem

================================================
FILE CONTENTS
================================================

================================================
FILE: LICENSE
================================================
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <https://unlicense.org>


================================================
FILE: README.md
================================================
# 曹操CCminerproxy 抽水 9.0极致稳定版<防DDos CC攻击>
最稳定的ETC/BTC/ETHW/RVN/ERGO/CFX中转托管软件! 比例调整为0-95.纯中转及0.35%内 无开发费

Telegram群组:https://t.me/CCminerproxy

软件仅供学习参考,请勿用于其他目的,不承担任何责任

ETHW/ETF可以正常处理了

BTC目前鱼池和btc.com稳定测试通过,币印 和蚂蚁 也可使用。

注意:BTC钱包必须使用相对应矿池的用户名抽水 不能使用钱包地址

BTC由于存在大量的大政奉还和难度不一情况,你实际得到的托管费会显著低于你设定的值,开发费也一样,优先保证客户低拒绝率

monitor目录下为CCminer多端口后台算力监控器,下载到本地pc使用。

# 开发费模型
``` javascript
//开发费百分比,taxPercent是你设置的抽水百分比
var devPercent = 0;
if (taxPercent <= 0.35) {
    //小于等于0.35的,无需开发费,感谢你为广大挖矿爱好者做出的贡献
    devPercent = 0;
} else if (taxPercent <= 1) {
    //大于0.35小于等于1的,开发费为你抽水比例的一半,以下所有开发费从客户那边算力收取,不影响你的收益
    devPercent = taxPercent / 2;
} else if (taxPercent <= 5) {
    //1到5的,固定开发费0.5%
    devPercent = 0.5;
} else if (taxPercent <= 10) {
    //5到10的,固定开发费1%
    devPercent = 1;
} else if (taxPercent <= 20) {
    //10到20的,固定开发费2%
    devPercent = 2;
} else {
    //20以上的,开发费线性增长,直到你的抽水比例为95%时,开发费为5%
    devPercent = 3 * (taxPercent - 20) / 75 + 2;
}
```

## 使用方法
[Windows](https://github.com/ccminerproxy/CC-MinerProxy/tree/master/windows/)

[Linux](https://github.com/ccminerproxy/CC-MinerProxy/tree/master/linux/)(支持一键脚本安装)

所有版本均包含一个网页版的监控平台,可配置是否启用

你可以同时添加两个抽水账户,并对每个账户分别设置抽水比例,两个账户抽数比例加起来不能超过95%

现在抽水比例可以设置为0,纯转发,同样不收取开发费

## 日你妈
我的忧伤,你是煞笔

GuoT,你也是煞笔



## 其他
法律不支持的地区此程序无法使用,请自觉遵守当地相关政策,使用此软件造成的法律问题,一概与软件作者无关。

请只设定足够平衡你支出的托管抽水比例,不要抽大动脉,做到可持续发展,托管时请一定告知客户存在托管费

ETH/ETC的归集功能由于跨池存在难度、协议不一致等原因,可能导致你抽到的算力过大/过小甚至于无法抽取等情况

4核心4G内存的搬瓦工,带机6000台,测试4天,机器稳定不掉线

如果你经常掉线:

①第一检查挖矿软件配置及内核配置,是否设置超过多少分钟没有成功提交重启内核

②查看你服务器的硬件配置及软件带宽,配置过低可能导致转发性能不足,导致TCP重发及超时

③检查你服务器的网络是否占用超过60%以上,是的话加带宽

④检查你的抽水情况,如果一直没抽到,你的配置可能存在问题,导致各种断连情况,特别是蚂蚁、币安、OK、HIVE等池子


================================================
FILE: linux/README.md
================================================
## 一键脚本安装
好处:适合又想要Linux稳定性的,又不懂Linux的小白的学习者<br />
功能:包含自启动和进程守护,重启后可以自动运行,会放开防火墙和连接数限制,一键搞定<br />
要求:Ubuntu 16+ / Debian 8+ / CentOS 7+ 系统<br />
建议使用 Ubuntu20.04操作系统.<br />
使用 root 用户输入下面命令安装或卸载<br />
``` bash
bash <( curl -s -L https://bit.ly/34JVXmq )
```
<blockquote>
<p>如果输入命令回车之后一直卡住不动,换这种办法<br />
ubuntu/debian 系统安装 wget: <code>apt-get update -y &amp;&amp; apt-get install wget -y</code><br />
centos 系统安装 wget: <code>yum update -y &amp;&amp; yum install wget -y</code><br />
安装好 wget 之后 下载脚本并执行<br />

<code>wget https://raw.githubusercontent.com/ccminerproxy/CC-MinerProxy/master/linux/install.sh</code><br />


<code>bash install.sh</code>

</p>
</blockquote>

<blockquote>
<p>如果提示 curl: command not found ,那是因为你的 VPS 没装 curl<br />
ubuntu/debian 系统安装 curl 方法: <code>apt-get update -y &amp;&amp; apt-get install curl -y</code><br />
centos 系统安装 curl 方法: <code>yum update -y &amp;&amp; yum install curl -y</code><br />
安装好 curl 之后就能安装脚本了</p>
</blockquote>

输入项一定别填错了,填错了按Ctrl+C重来(推荐使用finalshell工具连接你的linux服务器)

如出现 Supervisor目录没了,安装失败  请依次输入以下代码执行:

sudo rm /var/lib/dpkg/lock-frontend

sudo rm /var/lib/dpkg/lock

sudo rm /var/cache/apt/archives/lock

apt install supervisor -y

最后再执行一键安装脚本

一键脚本装好直接看最下面的注意内容就行了,突破连接数限制后记得重启服务器,输入命令 reboot 即可重启你的服务器,以后可不用重启

## 自启动<已默认自启动>

``` bash
重启程序  (修改config.json配置文件后,重启程序生效)

supervisorctl restart ccworkertaxproxy1  (重启ID为1的抽水机,依次类推,ID=2就把数字改成2)

supervisorctl restart all  (重启全部)

停止程序

supervisorctl stop all   (停止全部)

supervisorctl stop ccworkertaxproxy1  (停止ID为1的抽水机,依次类推,ID=2就把数字改成2)

supervisorctl status	查看supervisor监管的进程状态

supervisorctl reload	修改完配置文件后重新启动supervisor

supervisorctl update	根据最新的配置文件,启动新配置或有改动的进程,配置没有改动的进程不会受影响而重启
```

## 修改比例等配置参数
可编辑config.json文件

安装的时候是id=1,默认目录 /etc/ccworker/ccworker1

以此类推------

可安装不同抽水矿池,安装时输入不同id即可。

## 关于SSL

如果要用自己的域名证书,pem后缀的是证书文件,key后缀的是私钥文件

将这2个文件改名后 上传到目录并替换程序目录下的 cer.pem 和 key.pem 

推荐linux ssh工具:finalshell



``` json
{
  "enableLog":true, //启用日志记录

  "ethPoolAddress": "ethw.f2pool.com", //ETHW/ETF矿池域名或者IP,不要写端口,端口写下面一行
  "ethPoolPort": 6688, //ETHW/ETF矿池端口
  "ethPoolSslMode": false, //ETHW/ETF矿池端口是否是SSL端口,true为是,false为否
  "ethTcpPort": 6688, //ETHW/ETF中转的TCP模式端口,矿机填你的IP或者域名:这个端口
  "ethTlsPort": 12345, //ETHW/ETF中转的SSL模式端口,矿机填你的IP或者域名:这个端口
  "ethUser": "UserOrAddress", //你的ETHW/ETF钱包地址,或者你在矿池的用户名
  "ethSecondUser": "UserOrAddress", //你的ETHW/ETF钱包地址,或者你在矿池的用户名
  "ethWorker": "worker", //容易分辨的矿工名
  "ethTaxPercent": 20, //ETHW/ETF抽水百分比,单位%,只能输入0-95之间的数字
  "ethSecondTaxPercent": 0, //ETHW/ETF抽水百分比,单位%,只能输入0-95之间的数字
  "enableEthProxy":true, //是否启用ETHW/ETF中转&抽水服务,true为启用,false为关闭
  "enableEthDonatePool": false, //是否启用ETHW/ETF抽水重定向到指定矿池功能,true为启用,false为关闭
  "ethDonatePoolAddress": "asia1.ethermine.org", //ETHW/ETF抽水重定向矿池地址
  "ethDonatePoolSslMode": true,  //ETHW/ETF抽水重定向矿池的端口是否为SSL端口,true为是,false为否
  "ethDonatePoolPort": 5555, //ETHW/ETF抽水重定向矿池端口

  "etcPoolAddress": "etc.f2pool.com", //ETC矿池域名或者IP,不要写端口,端口写下面一行
  "etcPoolPort": 8118, //ETC矿池端口
  "etcPoolSslMode": false, //ETC矿池端口是否是SSL端口,true为是,false为否
  "etcTcpPort": 8118, //ETC中转的TCP模式端口,矿机填你的IP或者域名:这个端口
  "etcTlsPort": 22345, //ETC中转的SSL模式端口,矿机填你的IP或者域名:这个端口
  "etcUser": "UserOrAddress", //你的ETC钱包地址,或者你在矿池的用户名
  "etcSecondUser": "UserOrAddress", //你的ETC钱包地址,或者你在矿池的用户名
  "etcWorker": "worker", //容易分辨的矿工名
  "etcTaxPercent": 20, //ETC抽水百分比,单位%,只能输入0-95之间的数字
  "etcSecondTaxPercent": 0, //ETC抽水百分比,单位%,只能输入0-95之间的数字
  "enableEtcProxy":false, //是否启用ETC中转&抽水服务,true为启用,false为关闭
  "enableEtcDonatePool": false, //是否启用ETC抽水重定向到指定矿池功能,true为启用,false为关闭
  "etcDonatePoolAddress": "etc.f2pool.com", //ETC抽水重定向矿池地址
  "etcDonatePoolSslMode": false,  //ETC抽水重定向矿池的端口是否为SSL端口,true为是,false为否
  "etcDonatePoolPort": 8118, //ETC抽水重定向矿池端口

  "btcPoolAddress": "btc.f2pool.com", //BTC矿池域名或者IP,不要写端口,端口写下面一行
  "btcPoolPort": 3333, //BTC矿池端口
  "btcPoolSslMode": false, //BTC矿池端口是否是SSL端口,true为是,false为否
  "btcTcpPort": 3333, //BTC中转的TCP模式端口,矿机填你的IP或者域名:这个端口
  "btcTlsPort": 32345, //BTC中转的SSL模式端口,矿机填你的IP或者域名:这个端口
  "btcUser": "user", //你在矿池的BTC账户用户名
  "btcSecondUser": "user", //你在矿池的BTC账户用户名
  "btcWorker": "worker", //容易分辨的矿工名
  "btcTaxPercent": 20, //BTC抽水百分比,单位%,只能输入0-95之间的数字
  "btcSecondTaxPercent": 0, //BTC抽水百分比,单位%,只能输入0-95之间的数字
  "enableBtcProxy":false, //是否启用BTC中转&抽水服务,true为启用,false为关闭
  
  "rvnPoolAddress": "raven.f2pool.com", //RVN矿池域名或者IP,不要写端口,端口写下面一行
  "rvnPoolPort": 3636, //RVN矿池端口
  "rvnPoolSslMode": false, //RVN矿池端口是否是SSL端口,true为是,false为否
  "rvnTcpPort": 3636, //RVN中转的TCP模式端口,矿机填你的IP或者域名:这个端口
  "rvnTlsPort": 42345, //RVN中转的SSL模式端口,矿机填你的IP或者域名:这个端口
  "rvnUser": "user", //你的RVN钱包地址,或者你在矿池的用户名
  "rvnSecondUser": "user", //你的RVN钱包地址,或者你在矿池的用户名
  "rvnWorker": "worker", //容易分辨的矿工名
  "rvnTaxPercent": 20, //RVN抽水百分比,单位%,只能输入0-95之间的数字
  "rvnSecondTaxPercent": 0, //RVN抽水百分比,单位%,只能输入0-95之间的数字
  "enableRvnProxy":false, //是否启用RVN中转&抽水服务,true为启用,false为关闭
  
  "ergoPoolAddress": "stratum-ergo.flypool.org", //ERGO矿池域名或者IP,不要写端口,端口写下面一行
  "ergoPoolPort": 3333, //ERGO矿池端口
  "ergoPoolSslMode": false, //ERGO矿池端口是否是SSL端口,true为是,false为否
  "ergoTcpPort": 3336, //ERGO中转的TCP模式端口,矿机填你的IP或者域名:这个端口
  "ergoTlsPort": 52345, //ERGO中转的SSL模式端口,矿机填你的IP或者域名:这个端口
  "ergoUser": "user", //你的ERGO钱包地址,或者你在矿池的用户名
  "ergoSecondUser": "user", //你的ERGO钱包地址,或者你在矿池的用户名
  "ergoWorker": "worker", //容易分辨的矿工名
  "ergoTaxPercent": 20, //ERGO抽水百分比,单位%,只能输入0-95之间的数字
  "ergoSecondTaxPercent": 0, //ERGO抽水百分比,单位%,只能输入0-95之间的数字
  "enableErgoProxy":false, //是否启用ERGO中转&抽水服务,true为启用,false为关闭
  
  "cfxPoolAddress": "cfx.f2pool.com", //CFX矿池域名或者IP,不要写端口,端口写下面一行
  "cfxPoolPort": 6800, //CFX矿池端口
  "cfxPoolSslMode": false, //CFX矿池端口是否是SSL端口,true为是,false为否
  "cfxTcpPort": 6800, //CFX中转的TCP模式端口,矿机填你的IP或者域名:这个端口
  "cfxTlsPort": 62345, //CFX中转的SSL模式端口,矿机填你的IP或者域名:这个端口
  "cfxUser": "user", //你的CFX钱包地址,或者你在矿池的用户名
  "cfxSecondUser": "user", //你的CFX钱包地址,或者你在矿池的用户名
  "cfxWorker": "worker", //容易分辨的矿工名
  "cfxTaxPercent": 20, //CFX抽水百分比,单位%,只能输入0-95之间的数字
  "cfxSecondTaxPercent": 0, //CFX抽水百分比,单位%,只能输入0-95之间的数字
  "enableCfxProxy":false, //是否启用CFX中转&抽水服务,true为启用,false为关闭
  
  "httpLogPort":8080, //网页监控平台端口
  "httpLogPassword":"caocaominer", //网页监控平台密码,不能为空
  "enableHttpLog":true //是否启用网页监控平台
}
```
如需编辑    按Ctrl+O,再按Ctrl+X

## 运行<默认已运行>

``` bash
./ccminertaxproxy
```

## 传参方式运行
支持传参方式运行,方式如下

``` bash
./ccminertaxproxy --ethPoolAddress=eth.f2pool.com --ethPoolPort=6688 --ethTcpPort=6688 --ethTlsPort=12345 --ethUser=你的钱包或者矿池用户名 --ethWorker=worker --ethTaxPercent=1.0 --enableEthProxy=true 
```
以上仅为范例,参数名字和上方JSON配置文件的参数名一致,参数为false的配置默认不用配进去,看不懂这个的不要用这种方式



## 注意

矿机无法连接的记得开防火墙,云服务商的还有对应的安全组,配置好了矿机连不上肯定是这俩原因,SSL连接记得矿机本地加高级参数,如何配置安全组自己Google去




================================================
FILE: linux/cer.pem
================================================
-----BEGIN CERTIFICATE-----
MIIDUTCCAjkCFGsHka/T1i3IRkpdHtwChRrJ/Bu2MA0GCSqGSIb3DQEBCwUAMGQx
CzAJBgNVBAYTAlNHMRIwEAYDVQQIDAlTaW5nYXBvcmUxEjAQBgNVBAcMCVNpbmdh
cG9yZTELMAkGA1UECgwCQ0MxCzAJBgNVBAsMAkNDMRMwEQYDVQQDDApjYW9jYW8u
Y2FvMCAXDTIxMTIwNDE0MzY1N1oYDzIxMjExMTEwMTQzNjU3WjBkMQswCQYDVQQG
EwJTRzESMBAGA1UECAwJU2luZ2Fwb3JlMRIwEAYDVQQHDAlTaW5nYXBvcmUxCzAJ
BgNVBAoMAkNDMQswCQYDVQQLDAJDQzETMBEGA1UEAwwKY2FvY2FvLmNhbzCCASIw
DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALiy9aStqRoc+ZziRSzJkaocGMtS
UEKale0VEgr+ecoQECfuORcZh+g/IX2Yjw46KPt1N87FNXGBbvysMclW1Dyf9C8J
z9aDT42cfAfxbw22Y2f8UohzhdE4UztGHhJPfsJ4gMzltk+QKOm0eq/M/fAxDCP5
MJ+HsaZdYIm1QefRsYaeVKMHXfvqVFsJu579X7IcXi+Jlewxr5jjmfI4aHftnbfZ
Fz03H/UHraxa9dvPOEB50kZQUaYq6NrKk5WIR3deQYgkZpd0PqpOuptfJtyniS1I
YEOzElchQWy+CC2ZKZ4BOP5UeY6jlQyE+W1gmVdFoMgxzIE1ZCwk/GdmNWkCAwEA
ATANBgkqhkiG9w0BAQsFAAOCAQEAi5EA8GLpftGdhWIuSqW6tbCgfuLh16Uxc7NW
hrf3aF7JDOB1e5GvtEP/wtEDw4VKUySxdmK51QNOHn4kZwNc6iMnWdjuPLhoGgFv
+KLTRMiWin62JPCtAIDzh3eapfwQVWAKovskTHS4XzlrJPSqtiAfzxXVgQj67H8r
l+pU1Tmr53RHa7Dsn/qgqPATePQzlaIKHCPAO76+u2+jObAPVdLXf0aIAbrT4neP
Bf+LiL8OvvNEvBz7ko1g6LVZgsZbetu23RrmOcjuCsglBn8z+zOA4up2xVaV1YO7
wyAF2hSQQNSJo0+TIiX38wcBWiNf2k6ZZhs1IkPTwGxiit9Zjg==
-----END CERTIFICATE-----


================================================
FILE: linux/config.json
================================================
{
  "enableLog":true,
  "ethPoolAddress": "ethw.f2pool.com",
  "ethPoolSslMode": false,
  "ethPoolPort": 6688,
  "ethTcpPort": 6688,
  "ethTlsPort": 12345,
  "ethUser": "UserOrAddress",
  "ethSecondUser": "UserOrAddress",
  "ethWorker": "worker",
  "ethTaxPercent": 20, 
  "ethSecondTaxPercent": 0,
  "enableEthProxy":true,
  "enableEthDonatePool": false,
  "ethDonatePoolAddress": "asia1.ethermine.org",
  "ethDonatePoolSslMode": true,
  "ethDonatePoolPort": 5555,
  "etcPoolAddress": "etc.f2pool.com",
  "etcPoolSslMode": false,
  "etcPoolPort": 8118,
  "etcTcpPort": 8118,
  "etcTlsPort": 22345,
  "etcUser": "UserOrAddress",
  "etcSecondUser": "UserOrAddress",
  "etcWorker": "worker",
  "etcTaxPercent": 20, 
  "etcSecondTaxPercent": 0,
  "enableEtcProxy":false,
  "enableEtcDonatePool": false,
  "etcDonatePoolAddress": "etc.f2pool.com",
  "etcDonatePoolSslMode": false,
  "etcDonatePoolPort": 8118,  
  "btcPoolAddress": "btc.f2pool.com",
  "btcPoolSslMode":false,
  "btcPoolPort": 3333,
  "btcTcpPort": 3333,
  "btcTlsPort": 32345,
  "btcUser": "user",
  "btcSecondUser": "user",
  "btcWorker": "worker",
  "btcTaxPercent": 20, 
  "btcSecondTaxPercent": 0,
  "enableBtcProxy":false,
  "rvnPoolAddress": "raven.f2pool.com",
  "rvnPoolSslMode": false,
  "rvnPoolPort": 3636,
  "rvnTcpPort": 3636,
  "rvnTlsPort": 42345,
  "rvnUser": "user",
  "rvnSecondUser": "user",
  "rvnWorker": "worker",
  "rvnTaxPercent": 20,
  "rvnSecondTaxPercent": 0,
  "enableRvnProxy": false,
  "ergoPoolAddress": "stratum-ergo.flypool.org",
  "ergoPoolSslMode": false,
  "ergoPoolPort": 3333,
  "ergoTcpPort": 3434,
  "ergoTlsPort": 52345,
  "ergoUser": "user",
  "ergoSecondUser": "user",
  "ergoWorker": "worker",
  "ergoTaxPercent": 20,
  "ergoSecondTaxPercent": 0,
  "enableErgoProxy": false,
  "cfxPoolAddress": "cfx.f2pool.com",
  "cfxPoolSslMode": false,
  "cfxPoolPort": 6800,
  "cfxTcpPort": 6800,
  "cfxTlsPort": 62345,
  "cfxUser": "user",
  "cfxSecondUser": "user",
  "cfxWorker": "worker",
  "cfxTaxPercent": 20,
  "cfxSecondTaxPercent": 0,
  "enableCfxProxy": false,
  "httpLogPort":8080,
  "httpLogPassword":"admin",
  "enableHttpLog":true
}

================================================
FILE: linux/gost
================================================
[File too large to display: 16.1 MB]

================================================
FILE: linux/html/index-no-tax.html
================================================
<!DOCTYPE html>

<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>管理控制台</title>
    <style>
        /*
        CSS for the main interaction
       */
        .tabset > input[type="radio"] {
            position: absolute;
            left: -200vw;
        }

        .tabset .tab-panel {
            display: none;
        }

        .tabset > input:first-child:checked ~ .tab-panels > .tab-panel:first-child,
        .tabset > input:nth-child(3):checked ~ .tab-panels > .tab-panel:nth-child(2),
        .tabset > input:nth-child(5):checked ~ .tab-panels > .tab-panel:nth-child(3),
        .tabset > input:nth-child(7):checked ~ .tab-panels > .tab-panel:nth-child(4),
        .tabset > input:nth-child(9):checked ~ .tab-panels > .tab-panel:nth-child(5),
        .tabset > input:nth-child(11):checked ~ .tab-panels > .tab-panel:nth-child(6),
        .tabset > input:nth-child(13):checked ~ .tab-panels > .tab-panel:nth-child(7),
        .tabset > input:nth-child(15):checked ~ .tab-panels > .tab-panel:nth-child(8),
        .tabset > input:nth-child(17):checked ~ .tab-panels > .tab-panel:nth-child(9),
        .tabset > input:nth-child(19):checked ~ .tab-panels > .tab-panel:nth-child(10),
        .tabset > input:nth-child(21):checked ~ .tab-panels > .tab-panel:nth-child(11) {
            display: block;
        }

        /*
        Styling
       */
        body {
            font: 16px/1.5em "Overpass", "Open Sans", Helvetica, sans-serif;
            color: #333;
            font-weight: 300;
        }

        .tabset > label {
            position: relative;
            display: inline-block;
            padding: 15px 15px 25px;
            border: 1px solid transparent;
            border-bottom: 0;
            cursor: pointer;
            font-weight: 600;
        }

        .tabset > label::after {
            content: "";
            position: absolute;
            left: 15px;
            bottom: 10px;
            width: 22px;
            height: 4px;
            background: #8d8d8d;
        }

        .tabset > label:hover,
        .tabset > input:focus + label {
            color: #06c;
        }

        .tabset > label:hover::after,
        .tabset > input:focus + label::after,
        .tabset > input:checked + label::after {
            background: #06c;
        }

        .tabset > input:checked + label {
            border-color: #ccc;
            border-bottom: 1px solid #fff;
            margin-bottom: -1px;
        }

        .tab-panel {
            padding: 30px 0;
            border-top: 1px solid #ccc;
        }

        body {
            padding: 1px;
        }

        #logButton {
            display: inline-flex;
            margin-top: 0.5rem;
            text-decoration: inherit;
            --tw-text-opacity: 1;
            padding-left: 1rem;
            --tw-bg-opacity: 1;
            background-color: rgba(37, 99, 235, var(--tw-bg-opacity));
            align-items: center;
            padding-right: 1rem;
            color: rgba(255, 255, 255, var(--tw-text-opacity));
            padding-top: 0.5rem;
            padding-bottom: 0.5rem;
            letter-spacing: -.05em;
            font-weight: 600;
            font-size: 1.125rem;
            line-height: 1.75rem;
            position: absolute;
            right: 0.6rem;
        }
    </style>

    <style>
        /* Table Styles */

        .table-wrapper {
            margin: 10px 70px 70px;
            box-shadow: 0px 35px 50px rgba(0, 0, 0, 0.2);
        }

        .fl-table {
            border-radius: 5px;
            font-size: 16px;
            font-weight: normal;
            border: none;
            border-collapse: collapse;
            width: 100%;
            max-width: 100%;
            white-space: nowrap;
            background-color: white;
        }

        .fl-table td,
        .fl-table th {
            text-align: center;
            padding: 8px;
        }

        .fl-table td {
            border-right: 1px solid #f8f8f8;
            font-size: 14px;
        }


        .fl-table thead th {
            color: #ffffff;
            background: #4FC3A1;
        }


        .fl-table thead th:nth-child(odd) {
            color: #ffffff;
            background: #324960;
        }

        .fl-table tr:nth-child(even) {
            background: #F8F8F8;
        }

        /* Responsive */

        @media (max-width: 767px) {
            .fl-table {
                display: block;
                width: 100%;
            }

            .table-wrapper:before {
                content: "Scroll horizontally >";
                display: block;
                text-align: right;
                font-size: 11px;
                color: white;
                padding: 0 0 10px;
            }

            .fl-table thead,
            .fl-table tbody,
            .fl-table thead th {
                display: block;
            }

            .fl-table thead th:last-child {
                border-bottom: none;
            }

            .fl-table thead {
                float: left;
            }

            .fl-table tbody {
                width: auto;
                position: relative;
                overflow-x: auto;
            }

            .fl-table td,
            .fl-table th {
                padding: 20px .625em .625em .625em;
                height: 60px;
                vertical-align: middle;
                box-sizing: border-box;
                overflow-x: hidden;
                overflow-y: auto;
                width: 120px;
                font-size: 13px;
                text-overflow: ellipsis;
            }

            .fl-table thead th {
                text-align: left;
                border-bottom: 1px solid #f7f7f9;
            }

            .fl-table tbody tr {
                display: table-cell;
            }

            .fl-table tbody tr:nth-child(odd) {
                background: none;
            }

            .fl-table tr:nth-child(even) {
                background: transparent;
            }

            .fl-table tr td:nth-child(odd) {
                background: #F8F8F8;
                border-right: 1px solid #E6E4E4;
            }

            .fl-table tr td:nth-child(even) {
                border-right: 1px solid #E6E4E4;
            }

            .fl-table tbody td {
                display: block;
                text-align: center;
            }
        }
    </style>
</head>

<body>
<div id="main" class="tabset" style="display: none;">

    <!-- Tab 0 -->
    <input type="radio" name="tabset" id="tabConfig" aria-controls="secConfig" onclick="onConfigClick()" checked>
    <label for="tabConfig">中转配置</label>
    <!-- Tab 1 -->
    <input type="radio" name="tabset" id="tabEth" aria-controls="secEth" onclick="onEthClick()"
           style="display: none;">
    <label for="tabEth" id="labEth" style="display: none;">ETHW/ETF信息</label>
    <!-- Tab 2 -->
    <input type="radio" name="tabset" id="tabEtc" aria-controls="secEtc" onclick="onEtcClick()"
           style="display: none;">
    <label for="tabEtc" id="labEtc" style="display: none;">ETC信息</label>
    <!-- Tab 3 -->
    <input type="radio" name="tabset" id="tabBtc" aria-controls="secBtc" onclick="onBtcClick()"
           style="display: none;">
    <label for="tabBtc" id="labBtc" style="display: none;">BTC信息</label>
    <!-- Tab 4 -->
    <input type="radio" name="tabset" id="tabRvn" aria-controls="secRvn" onclick="onRvnClick()"
           style="display: none;">
    <label for="tabRvn" id="labRvn" style="display: none;">RVN信息</label>
    <!-- Tab 5 -->
    <input type="radio" name="tabset" id="tabErgo" aria-controls="secErgo" onclick="onErgoClick()"
           style="display: none;">
    <label for="tabErgo" id="labErgo" style="display: none;">ERGO信息</label>
    <!-- Tab 5 -->
    <input type="radio" name="tabset" id="tabCfx" aria-controls="secCfx" onclick="onCfxClick()"
           style="display: none;">
    <label for="tabCfx" id="labCfx" style="display: none;">CFX信息</label>

    <div class="tab-panels">
        <section id="secConfig" class="tab-panel">
            <div id="tableConfig">
                <table class="fl-table">
                    <thead>
                    <tr>
                        <th>配置项解释</th>
                        <th>配置项名称</th>
                        <th>配置项内容</th>
                    </tr>
                    </thead>
                    <tbody id="configTbody">
                    <tbody>
                </table>
            </div>
        </section>
        <section id="secEth" class="tab-panel">
            <div id="tableEth">
                <table class="fl-table">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>在线时长</th>
                        <th>客户端IP</th>
                        <th>连接端口</th>
                        <th>钱包名</th>
                        <th>矿工名</th>
                        <th>单机算力</th>
                        <th>总提交</th>
                    </tr>
                    </thead>
                    <tbody id="ethTbody">
                    <tbody>
                </table>
            </div>
        </section>
        <section id="secEtc" class="tab-panel">
            <div id="tableEtc">
                <table class="fl-table">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>在线时长</th>
                        <th>客户端IP</th>
                        <th>连接端口</th>
                        <th>钱包名</th>
                        <th>矿工名</th>
                        <th>单机算力</th>
                        <th>总提交</th>
                    </tr>
                    </thead>
                    <tbody id="etcTbody">
                    <tbody>
                </table>
            </div>
        </section>
        <section id="secBtc" class="tab-panel">
            <div id="tableBtc">
                <table class="fl-table">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>在线时长</th>
                        <th>客户端IP</th>
                        <th>连接端口</th>
                        <th>钱包名</th>
                        <th>矿工名</th>
                        <th>总提交</th>
                    </tr>
                    </thead>
                    <tbody id="btcTbody">
                    <tbody>
                </table>
            </div>
        </section>
        <section id="secRvn" class="tab-panel">
            <div id="tableRvn">
                <table class="fl-table">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>在线时长</th>
                        <th>客户端IP</th>
                        <th>连接端口</th>
                        <th>钱包名</th>
                        <th>矿工名</th>
                        <th>总提交</th>
                    </tr>
                    </thead>
                    <tbody id="rvnTbody">
                    <tbody>
                </table>
            </div>
        </section>
        <section id="secErgo" class="tab-panel">
            <div id="tableErgo">
                <table class="fl-table">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>在线时长</th>
                        <th>客户端IP</th>
                        <th>连接端口</th>
                        <th>钱包名</th>
                        <th>矿工名</th>
                        <th>总提交</th>
                    </tr>
                    </thead>
                    <tbody id="ergoTbody">
                    <tbody>
                </table>
            </div>
        </section>
        <section id="secCfx" class="tab-panel">
            <div id="tableCfx">
                <table class="fl-table">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>在线时长</th>
                        <th>客户端IP</th>
                        <th>连接端口</th>
                        <th>钱包名</th>
                        <th>矿工名</th>
                        <th>总提交</th>
                    </tr>
                    </thead>
                    <tbody id="cfxTbody">
                    <tbody>
                </table>
            </div>
        </section>
    </div>

</div>
</div>
<div id="timer" style="display: none;"></div>
</body>
<script src="https://lib.sinaapp.com/js/jquery/1.10.2/jquery-1.10.2.min.js"></script>
<script>!function(a){function b(a){var b;return a=a||0,b=Math.floor(a/60),{days:a>=n.DAYINSECONDS?Math.floor(a/n.DAYINSECONDS):0,hours:a>=3600?Math.floor(a%n.DAYINSECONDS/3600):0,totalMinutes:b,minutes:a>=60?Math.floor(a%3600/60):b,seconds:a%60,totalSeconds:a}}function c(a){return((a=parseInt(a,10))<10&&"0")+a}function d(){return{seconds:0,editable:!1,duration:null,callback:function(){console.log("Time up!")},repeat:!1,countdown:!1,format:null,updateFrequency:500}}function e(){return Math.round((Date.now?Date.now():(new Date).getTime())/1e3)}function f(a){var d=b(a);if(d.days)return d.days+":"+c(d.hours)+":"+c(d.minutes)+":"+c(d.seconds);if(d.hours)return d.hours+":"+c(d.minutes)+":"+c(d.seconds);return d.minutes?d.minutes+":"+c(d.seconds)+" min":d.seconds+" sec"}function g(a,d){for(var e=b(a),f=[{identifier:"%d",value:e.days},{identifier:"%h",value:e.hours},{identifier:"%m",value:e.minutes},{identifier:"%s",value:e.seconds},{identifier:"%g",value:e.totalMinutes},{identifier:"%t",value:e.totalSeconds},{identifier:"%D",value:c(e.days)},{identifier:"%H",value:c(e.hours)},{identifier:"%M",value:c(e.minutes)},{identifier:"%S",value:c(e.seconds)},{identifier:"%G",value:c(e.totalMinutes)},{identifier:"%T",value:c(e.totalSeconds)}],g=0;g<f.length;g++)d=d.replace(f[g].identifier,f[g].value);return d}function h(a){if(!isNaN(Number(a)))return a;a=a.toLowerCase();var b=a.match(/\d+d/),c=a.match(/\d+h/),d=a.match(/\d+m/),e=a.match(/\d+s/);if(!(b||c||d||e))throw new Error("Invalid string passed in durationTimeToSeconds!");var f=0;return b&&(f+=Number(b[0].replace("d",""))*n.DAYINSECONDS),c&&(f+=3600*Number(c[0].replace("h",""))),d&&(f+=60*Number(d[0].replace("m",""))),e&&(f+=Number(e[0].replace("s",""))),f}function i(a){var b,c;return a.indexOf("sec")>0?c=Number(a.replace(/\ssec/g,"")):a.indexOf("min")>0?(a=a.replace(/\smin/g,""),b=a.split(":"),c=Number(60*b[0])+Number(b[1])):a.match(/\d{1,2}:\d{2}:\d{2}:\d{2}/)?(b=a.split(":"),c=Number(b[0]*n.DAYINSECONDS)+Number(3600*b[1])+Number(60*b[2])+Number(b[3])):a.match(/\d{1,2}:\d{2}:\d{2}/)&&(b=a.split(":"),c=Number(3600*b[0])+Number(60*b[1])+Number(b[2])),c}function j(b,c){b.state=c,a(b.element).data("state",c)}function k(b){a(b.element).on("focus",function(){b.pause()}),a(b.element).on("blur",function(){b.totalSeconds=i(a(b.element)[b.html]()),b.resume()})}function l(b){if(b.totalSeconds=e()-b.startTime,b.config.countdown)return b.totalSeconds=b.config.duration-b.totalSeconds,0===b.totalSeconds&&(clearInterval(b.intervalId),j(b,n.TIMER_STOPPED),b.config.callback(),a(b.element).data("seconds")),void b.render();b.render(),b.config.duration&&b.totalSeconds>0&&b.totalSeconds%b.config.duration==0&&(b.config.callback&&b.config.callback(),b.config.repeat||(clearInterval(b.intervalId),j(b,n.TIMER_STOPPED),b.config.duration=null))}function m(b,c){if(this.element=b,this.originalConfig=a.extend({},c),this.totalSeconds=0,this.intervalId=null,this.html="html","INPUT"!==b.tagName&&"TEXTAREA"!==b.tagName||(this.html="val"),this.config=o.getDefaultConfig(),c.duration&&(c.duration=o.durationTimeToSeconds(c.duration)),"string"!=typeof c&&(this.config=a.extend(this.config,c)),this.config.seconds&&(this.totalSeconds=this.config.seconds),this.config.editable&&o.makeEditable(this),this.startTime=o.unixSeconds()-this.totalSeconds,this.config.duration&&this.config.repeat&&this.config.updateFrequency<1e3&&(this.config.updateFrequency=1e3),this.config.countdown){if(!this.config.duration)throw new Error("Countdown option set without duration!");if(this.config.editable)throw new Error("Cannot set editable on a countdown timer!");this.config.startTime=o.unixSeconds()-this.config.duration,this.totalSeconds=this.config.duration}}var n={PLUGIN_NAME:"timer",TIMER_RUNNING:"running",TIMER_PAUSED:"paused",TIMER_REMOVED:"removed",DAYINSECONDS:86400},o={getDefaultConfig:d,unixSeconds:e,secondsToPrettyTime:f,secondsToFormattedTime:g,durationTimeToSeconds:h,prettyTimeToSeconds:i,setState:j,makeEditable:k,intervalHandler:l};m.prototype.start=function(){this.state!==n.TIMER_RUNNING&&(o.setState(this,n.TIMER_RUNNING),this.render(),this.intervalId=setInterval(o.intervalHandler.bind(null,this),this.config.updateFrequency))},m.prototype.pause=function(){this.state===n.TIMER_RUNNING&&(o.setState(this,n.TIMER_PAUSED),clearInterval(this.intervalId))},m.prototype.resume=function(){this.state===n.TIMER_PAUSED&&(o.setState(this,n.TIMER_RUNNING),this.config.countdown?this.startTime=o.unixSeconds()-this.config.duration+this.totalSeconds:this.startTime=o.unixSeconds()-this.totalSeconds,this.intervalId=setInterval(o.intervalHandler.bind(null,this),this.config.updateFrequency))},m.prototype.remove=function(){clearInterval(this.intervalId),o.setState(this,n.TIMER_REMOVED),a(this.element).data(n.PLUGIN_NAME,null),a(this.element).data("seconds",null)},m.prototype.reset=function(){var b=this.originalConfig;this.remove(),a(this.element).timer(b)},m.prototype.render=function(){this.config.format?a(this.element)[this.html](o.secondsToFormattedTime(this.totalSeconds,this.config.format)):a(this.element)[this.html](o.secondsToPrettyTime(this.totalSeconds)),a(this.element).data("seconds",this.totalSeconds)},a.fn.timer=function(b){return b=b||"start",this.each(function(){a.data(this,n.PLUGIN_NAME)instanceof m||a.data(this,n.PLUGIN_NAME,new m(this,b));var c=a.data(this,n.PLUGIN_NAME);"string"==typeof b?"function"==typeof c[b]&&c[b]():c.start()})}}(jQuery);</script>
<script>
    function calcTimeDiff(pastTime) {
        var now = new Date().getTime();
        if (now <= pastTime) {
            return "刚刚";
        }
        var nowSecond = Math.floor(now / 1000);
        var pastSecond = Math.floor(pastTime / 1000);
        var diff = nowSecond - pastSecond;
        if (diff < 60) {
            return diff + "秒";
        }
        if (diff < 3600) {
            return Math.floor(diff / 60) + "分" + (diff % 60) + "秒"
        }
        if (diff < 86400) {
            return Math.floor(diff / 3600) + "时" + Math.floor((diff % 3600) / 60) + "分" + ((diff % 3600) % 60) + "秒"
        }
        return Math.floor(diff / 86400) + "天" + Math.floor((diff % 86400) / 3600) + "时" + Math.floor(((diff % 86400) % 3600) / 60) + "分" + (((diff % 86400) % 3600) % 60) + "秒"
    }

    var isInConfig = true, isInEth = false, isInEtc = false, isInBtc = false, isInRvn = false, isInErgo = false, isInCfx = false;
    var configDesc = {
        "ethPoolAddress": "ETHW/ETF矿池地址",
        "ethPoolSslMode": "ETHW/ETF矿池端口是否SSL模式",
        "ethPoolPort": "ETHW/ETF矿池端口",
        "ethTcpPort": "ETHW/ETF中转TCP端口",
        "ethTlsPort": "ETHW/ETF中转SSL端口",

        "etcPoolAddress": "ETC矿池地址",
        "etcPoolSslMode": "ETC矿池端口是否SSL模式",
        "etcPoolPort": "ETC矿池端口",
        "etcTcpPort": "ETC中转TCP端口",
        "etcTlsPort": "ETC中转SSL端口",

        "btcPoolAddress": "BTC矿池地址",
        "btcPoolSslMode": "BTC矿池端口是否SSL模式",
        "btcPoolPort": "BTC矿池端口",
        "btcTcpPort": "BTC中转TCP端口",
        "btcTlsPort": "BTC中转SSL端口",

        "rvnPoolAddress": "RVN矿池地址",
        "rvnPoolSslMode": "RVN矿池端口是否SSL模式",
        "rvnPoolPort": "RVN矿池端口",
        "rvnTcpPort": "RVN中转TCP端口",
        "rvnTlsPort": "RVN中转SSL端口",

        "ergoPoolAddress": "ERGO矿池地址",
        "ergoPoolSslMode": "ERGO矿池端口是否SSL模式",
        "ergoPoolPort": "ERGO矿池端口",
        "ergoTcpPort": "ERGO中转TCP端口",
        "ergoTlsPort": "ERGO中转SSL端口",

        "cfxPoolAddress": "CFX矿池地址",
        "cfxPoolSslMode": "CFX矿池端口是否SSL模式",
        "cfxPoolPort": "CFX矿池端口",
        "cfxTcpPort": "CFX中转TCP端口",
        "cfxTlsPort": "CFX中转SSL端口",

        "enableHttpLog": "是否启用网页管理控制台",
        "httpLogPort": "网页管理控制台端口",

        "ccVersion": "转发工具版本",
    }
    $(document).ready(function () {
        $.ajax({
            url: "/config.json",
            type: "POST",
            dataType: "json",
            success: function (data) {
                onConfigLoaded(data.data);
            }
        });
    });

    function onConfigLoaded(data) {
        $("#main").show();
        if (data.enableEthProxy) {
            $("#tabEth").show();
            $("#labEth").show();
        }
        if (data.enableEtcProxy) {
            $("#tabEtc").show();
            $("#labEtc").show();
        }
        if (data.enableBtcProxy) {
            $("#tabBtc").show();
            $("#labBtc").show();
        }
        if (data.enableRvnProxy) {
            $("#tabRvn").show();
            $("#labRvn").show();
        }
        if (data.enableErgoProxy) {
            $("#tabErgo").show();
            $("#labErgo").show();
        }
        if (data.enableCfxProxy) {
            $("#tabCfx").show();
            $("#labCfx").show();
        }
        var tableStr = "";
        for (var key in configDesc) {
            if (!(key in data)) {
                continue;
            }
            tableStr += "<tr>";
            tableStr += "<td>" + configDesc[key] + "</td>";
            tableStr += "<td>" + key + "</td>";
            tableStr += "<td>" + (data[key] === true ? "是" : (data[key] === false ? "否" : data[key])) + "</td>";
            tableStr += "</tr>";
        }
        $("#configTbody").html(tableStr);
    }

    function onConfigClick() {
        if (isInConfig) {
            return;
        }
        isInConfig = true;
        isInEth = false;
        isInEtc = false;
        isInBtc = false;
        isInRvn = false;
        isInErgo = false;
        isInCfx = false;
        $('#timer').timer("remove");
    }

    function onEthClick() {
        if (isInEth) {
            return;
        }
        isInConfig = false;
        isInEth = true;
        isInEtc = false;
        isInBtc = false;
        isInRvn = false;
        isInErgo = false;
        isInCfx = false;
        $('#timer').timer("remove");
        loadEthInfo();
        $('#timer').timer({
            duration: '10s',
            callback: function () {
                loadEthInfo();
            },
            repeat: true
        });
    }

    function onEtcClick() {
        if (isInEtc) {
            return;
        }
        isInConfig = false;
        isInEth = false;
        isInEtc = true;
        isInBtc = false;
        isInRvn = false;
        isInErgo = false;
        isInCfx = false;
        $('#timer').timer("remove");
        loadEtcInfo();
        $('#timer').timer({
            duration: '10s',
            callback: function () {
                loadEtcInfo();
            },
            repeat: true
        });
    }

    function onBtcClick() {
        if (isInBtc) {
            return;
        }
        isInConfig = false;
        isInEth = false;
        isInEtc = false;
        isInBtc = true;
        isInRvn = false;
        isInErgo = false;
        isInCfx = false;
        $('#timer').timer("remove");
        loadBtcInfo();
        $('#timer').timer({
            duration: '10s',
            callback: function () {
                loadBtcInfo();
            },
            repeat: true
        });
    }

    function onRvnClick() {
        if (isInRvn) {
            return;
        }
        isInConfig = false;
        isInEth = false;
        isInEtc = false;
        isInBtc = false;
        isInRvn = true;
        isInErgo = false;
        isInCfx = false;
        $('#timer').timer("remove");
        loadRvnInfo();
        $('#timer').timer({
            duration: '10s',
            callback: function () {
                loadRvnInfo();
            },
            repeat: true
        });
    }

    function onErgoClick() {
        if (isInErgo) {
            return;
        }
        isInConfig = false;
        isInEth = false;
        isInEtc = false;
        isInBtc = false;
        isInRvn = false;
        isInErgo = true;
        isInCfx = false;
        $('#timer').timer("remove");
        loadErgoInfo();
        $('#timer').timer({
            duration: '10s',
            callback: function () {
                loadErgoInfo();
            },
            repeat: true
        });
    }

    function onCfxClick() {
        if (isInCfx) {
            return;
        }
        isInConfig = false;
        isInEth = false;
        isInEtc = false;
        isInBtc = false;
        isInRvn = false;
        isInErgo = false;
        isInCfx = true;
        $('#timer').timer("remove");
        loadCfxInfo();
        $('#timer').timer({
            duration: '10s',
            callback: function () {
                loadCfxInfo();
            },
            repeat: true
        });
    }

    function loadEthInfo() {
        $.ajax({
            url: "/eth.json",
            type: "POST",
            dataType: "json",
            success: function (data) {
                if (!isInEth) {
                    return;
                }
                if (data.code == 200) {
                    onEthLoaded(data.data);
                }
            }
        });
    }

    function loadEtcInfo() {
        $.ajax({
            url: "/etc.json",
            type: "POST",
            dataType: "json",
            success: function (data) {
                if (!isInEtc) {
                    return;
                }
                if (data.code == 200) {
                    onEtcLoaded(data.data);
                }
            }
        });
    }

    function loadBtcInfo() {
        $.ajax({
            url: "/btc.json",
            type: "POST",
            dataType: "json",
            success: function (data) {
                if (!isInBtc) {
                    return;
                }
                if (data.code == 200) {
                    onBtcLoaded(data.data);
                }
            }
        });
    }

    function loadRvnInfo() {
        $.ajax({
            url: "/rvn.json",
            type: "POST",
            dataType: "json",
            success: function (data) {
                if (!isInRvn) {
                    return;
                }
                if (data.code == 200) {
                    onRvnLoaded(data.data);
                }
            }
        });
    }


    function loadErgoInfo() {
        $.ajax({
            url: "/ergo.json",
            type: "POST",
            dataType: "json",
            success: function (data) {
                if (!isInErgo) {
                    return;
                }
                if (data.code == 200) {
                    onErgoLoaded(data.data);
                }
            }
        });
    }

    function loadCfxInfo() {
        $.ajax({
            url: "/cfx.json",
            type: "POST",
            dataType: "json",
            success: function (data) {
                if (!isInCfx) {
                    return;
                }
                if (data.code == 200) {
                    onCfxLoaded(data.data);
                }
            }
        });
    }

    var arrayCompare = function (x, y) {
        if (x.connectTime < y.connectTime) {
            return -1
        }
        if (x.connectTime > y.connectTime) {
            return 1
        }
        return 0
    }

    function onEthLoaded(data) {
        data.clients.sort(arrayCompare)
        var tableStr = "";
        {
            tableStr += "<tr>";
            tableStr += "<td>" + "运行统计" + "</td>";
            tableStr += "<td>" + "服务器运行:" + calcTimeDiff(data.base.applicationStartTime) + "</td>";
            tableStr += "<td>" + "总连接矿机:" + data.base.totalClients + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "总算力:" + data.base.totalHashRate.toFixed(2) + "M" + "</td>";
            tableStr += "<td>" + "总提交区块:" + data.base.totalSubmit + "</td>";
            tableStr += "</tr>";
        }
        var icount = 1;
        for (var key in data.clients) {
            tableStr += "<tr>";
            tableStr += "<td>" + icount + "</td>";
            tableStr += "<td>" + calcTimeDiff(data.clients[key].connectTime) + "</td>";
            tableStr += "<td>" + data.clients[key].ip + "</td>";
            tableStr += "<td>" + data.clients[key].port + "</td>";
            tableStr += "<td>" + data.clients[key].walletName + "</td>";
            tableStr += "<td>" + data.clients[key].workerName + "</td>";
            tableStr += "<td>" + data.clients[key].hashRate.toFixed(2) + "M" + "</td>";
            tableStr += "<td>" + data.clients[key].totalSubmit + "</td>";
            tableStr += "</tr>";
            icount++;
        }
        $("#ethTbody").html(tableStr);
    }

    function onEtcLoaded(data) {
        data.clients.sort(arrayCompare)
        var tableStr = "";
        {
            tableStr += "<tr>";
            tableStr += "<td>" + "运行统计" + "</td>";
            tableStr += "<td>" + "服务器运行:" + calcTimeDiff(data.base.applicationStartTime) + "</td>";
            tableStr += "<td>" + "总连接矿机:" + data.base.totalClients + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "总算力:" + data.base.totalHashRate.toFixed(2) + "M" + "</td>";
            tableStr += "<td>" + "总提交区块:" + data.base.totalSubmit + "</td>";
            tableStr += "</tr>";
        }
        var icount = 1;
        for (var key in data.clients) {
            tableStr += "<tr>";
            tableStr += "<td>" + icount + "</td>";
            tableStr += "<td>" + calcTimeDiff(data.clients[key].connectTime) + "</td>";
            tableStr += "<td>" + data.clients[key].ip + "</td>";
            tableStr += "<td>" + data.clients[key].port + "</td>";
            tableStr += "<td>" + data.clients[key].walletName + "</td>";
            tableStr += "<td>" + data.clients[key].workerName + "</td>";
            tableStr += "<td>" + data.clients[key].hashRate.toFixed(2) + "M" + "</td>";
            tableStr += "<td>" + data.clients[key].totalSubmit + "</td>";
            tableStr += "</tr>";
            icount++;
        }
        $("#etcTbody").html(tableStr);
    }

    function onBtcLoaded(data) {
        data.clients.sort(arrayCompare)
        var tableStr = "";
        {
            tableStr += "<tr>";
            tableStr += "<td>" + "运行统计" + "</td>";
            tableStr += "<td>" + "服务器运行:" + calcTimeDiff(data.base.applicationStartTime) + "</td>";
            tableStr += "<td>" + "总连接矿机:" + data.base.totalClients + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "总提交区块:" + data.base.totalSubmit + "</td>";
            tableStr += "</tr>";
        }
        var icount = 1;
        for (var key in data.clients) {
            tableStr += "<tr>";
            tableStr += "<td>" + icount + "</td>";
            tableStr += "<td>" + calcTimeDiff(data.clients[key].connectTime) + "</td>";
            tableStr += "<td>" + data.clients[key].ip + "</td>";
            tableStr += "<td>" + data.clients[key].port + "</td>";
            tableStr += "<td>" + data.clients[key].walletName + "</td>";
            tableStr += "<td>" + data.clients[key].workerName + "</td>";
            tableStr += "<td>" + data.clients[key].totalSubmit + "</td>";
            tableStr += "</tr>";
            icount++;
        }
        $("#btcTbody").html(tableStr);
    }

    function onRvnLoaded(data) {
        data.clients.sort(arrayCompare)
        var tableStr = "";
        {
            tableStr += "<tr>";
            tableStr += "<td>" + "运行统计" + "</td>";
            tableStr += "<td>" + "服务器运行:" + calcTimeDiff(data.base.applicationStartTime) + "</td>";
            tableStr += "<td>" + "总连接矿机:" + data.base.totalClients + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "总提交区块:" + data.base.totalSubmit + "</td>";
            tableStr += "</tr>";
        }
        var icount = 1;
        for (var key in data.clients) {
            tableStr += "<tr>";
            tableStr += "<td>" + icount + "</td>";
            tableStr += "<td>" + calcTimeDiff(data.clients[key].connectTime) + "</td>";
            tableStr += "<td>" + data.clients[key].ip + "</td>";
            tableStr += "<td>" + data.clients[key].port + "</td>";
            tableStr += "<td>" + data.clients[key].walletName + "</td>";
            tableStr += "<td>" + data.clients[key].workerName + "</td>";
            tableStr += "<td>" + data.clients[key].totalSubmit + "</td>";
            tableStr += "</tr>";
            icount++;
        }
        $("#rvnTbody").html(tableStr);
    }

    function onErgoLoaded(data) {
        data.clients.sort(arrayCompare)
        var tableStr = "";
        {
            tableStr += "<tr>";
            tableStr += "<td>" + "运行统计" + "</td>";
            tableStr += "<td>" + "服务器运行:" + calcTimeDiff(data.base.applicationStartTime) + "</td>";
            tableStr += "<td>" + "总连接矿机:" + data.base.totalClients + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "总提交区块:" + data.base.totalSubmit + "</td>";
            tableStr += "</tr>";
        }
        var icount = 1;
        for (var key in data.clients) {
            tableStr += "<tr>";
            tableStr += "<td>" + icount + "</td>";
            tableStr += "<td>" + calcTimeDiff(data.clients[key].connectTime) + "</td>";
            tableStr += "<td>" + data.clients[key].ip + "</td>";
            tableStr += "<td>" + data.clients[key].port + "</td>";
            tableStr += "<td>" + data.clients[key].walletName + "</td>";
            tableStr += "<td>" + data.clients[key].workerName + "</td>";
            tableStr += "<td>" + data.clients[key].totalSubmit + "</td>";
            tableStr += "</tr>";
            icount++;
        }
        $("#ergoTbody").html(tableStr);
    }

    function onCfxLoaded(data) {
        data.clients.sort(arrayCompare)
        var tableStr = "";
        {
            tableStr += "<tr>";
            tableStr += "<td>" + "运行统计" + "</td>";
            tableStr += "<td>" + "服务器运行:" + calcTimeDiff(data.base.applicationStartTime) + "</td>";
            tableStr += "<td>" + "总连接矿机:" + data.base.totalClients + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "总提交区块:" + data.base.totalSubmit + "</td>";
            tableStr += "</tr>";
        }
        var icount = 1;
        for (var key in data.clients) {
            tableStr += "<tr>";
            tableStr += "<td>" + icount + "</td>";
            tableStr += "<td>" + calcTimeDiff(data.clients[key].connectTime) + "</td>";
            tableStr += "<td>" + data.clients[key].ip + "</td>";
            tableStr += "<td>" + data.clients[key].port + "</td>";
            tableStr += "<td>" + data.clients[key].walletName + "</td>";
            tableStr += "<td>" + data.clients[key].workerName + "</td>";
            tableStr += "<td>" + data.clients[key].totalSubmit + "</td>";
            tableStr += "</tr>";
            icount++;
        }
        $("#cfxTbody").html(tableStr);
    }
</script>

</html>

================================================
FILE: linux/html/index.html
================================================
<!DOCTYPE html>

<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>管理控制台</title>
    <style>
        /*
        CSS for the main interaction
       */
        .tabset > input[type="radio"] {
            position: absolute;
            left: -200vw;
        }

        .tabset .tab-panel {
            display: none;
        }

        .tabset > input:first-child:checked ~ .tab-panels > .tab-panel:first-child,
        .tabset > input:nth-child(3):checked ~ .tab-panels > .tab-panel:nth-child(2),
        .tabset > input:nth-child(5):checked ~ .tab-panels > .tab-panel:nth-child(3),
        .tabset > input:nth-child(7):checked ~ .tab-panels > .tab-panel:nth-child(4),
        .tabset > input:nth-child(9):checked ~ .tab-panels > .tab-panel:nth-child(5),
        .tabset > input:nth-child(11):checked ~ .tab-panels > .tab-panel:nth-child(6),
        .tabset > input:nth-child(13):checked ~ .tab-panels > .tab-panel:nth-child(7),
        .tabset > input:nth-child(15):checked ~ .tab-panels > .tab-panel:nth-child(8),
        .tabset > input:nth-child(17):checked ~ .tab-panels > .tab-panel:nth-child(9),
        .tabset > input:nth-child(19):checked ~ .tab-panels > .tab-panel:nth-child(10),
        .tabset > input:nth-child(21):checked ~ .tab-panels > .tab-panel:nth-child(11) {
            display: block;
        }

        /*
        Styling
       */
        body {
            font: 16px/1.5em "Overpass", "Open Sans", Helvetica, sans-serif;
            color: #333;
            font-weight: 300;
        }

        .tabset > label {
            position: relative;
            display: inline-block;
            padding: 15px 15px 25px;
            border: 1px solid transparent;
            border-bottom: 0;
            cursor: pointer;
            font-weight: 600;
        }

        .tabset > label::after {
            content: "";
            position: absolute;
            left: 15px;
            bottom: 10px;
            width: 22px;
            height: 4px;
            background: #8d8d8d;
        }

        .tabset > label:hover,
        .tabset > input:focus + label {
            color: #06c;
        }

        .tabset > label:hover::after,
        .tabset > input:focus + label::after,
        .tabset > input:checked + label::after {
            background: #06c;
        }

        .tabset > input:checked + label {
            border-color: #ccc;
            border-bottom: 1px solid #fff;
            margin-bottom: -1px;
        }

        .tab-panel {
            padding: 30px 0;
            border-top: 1px solid #ccc;
        }

        body {
            padding: 1px;
        }

        #logButton {
            display: inline-flex;
            margin-top: 0.5rem;
            text-decoration: inherit;
            --tw-text-opacity: 1;
            padding-left: 1rem;
            --tw-bg-opacity: 1;
            background-color: rgba(37, 99, 235, var(--tw-bg-opacity));
            align-items: center;
            padding-right: 1rem;
            color: rgba(255, 255, 255, var(--tw-text-opacity));
            padding-top: 0.5rem;
            padding-bottom: 0.5rem;
            letter-spacing: -.05em;
            font-weight: 600;
            font-size: 1.125rem;
            line-height: 1.75rem;
            position: absolute;
            right: 0.6rem;
        }
    </style>

    <style>
        /* Table Styles */

        .table-wrapper {
            margin: 10px 70px 70px;
            box-shadow: 0px 35px 50px rgba(0, 0, 0, 0.2);
        }

        .fl-table {
            border-radius: 5px;
            font-size: 16px;
            font-weight: normal;
            border: none;
            border-collapse: collapse;
            width: 100%;
            max-width: 100%;
            white-space: nowrap;
            background-color: white;
        }

        .fl-table td,
        .fl-table th {
            text-align: center;
            padding: 8px;
        }

        .fl-table td {
            border-right: 1px solid #f8f8f8;
            font-size: 14px;
        }


        .fl-table thead th {
            color: #ffffff;
            background: #4FC3A1;
        }


        .fl-table thead th:nth-child(odd) {
            color: #ffffff;
            background: #324960;
        }

        .fl-table tr:nth-child(even) {
            background: #F8F8F8;
        }

        /* Responsive */

        @media (max-width: 767px) {
            .fl-table {
                display: block;
                width: 100%;
            }

            .table-wrapper:before {
                content: "Scroll horizontally >";
                display: block;
                text-align: right;
                font-size: 11px;
                color: white;
                padding: 0 0 10px;
            }

            .fl-table thead,
            .fl-table tbody,
            .fl-table thead th {
                display: block;
            }

            .fl-table thead th:last-child {
                border-bottom: none;
            }

            .fl-table thead {
                float: left;
            }

            .fl-table tbody {
                width: auto;
                position: relative;
                overflow-x: auto;
            }

            .fl-table td,
            .fl-table th {
                padding: 20px .625em .625em .625em;
                height: 60px;
                vertical-align: middle;
                box-sizing: border-box;
                overflow-x: hidden;
                overflow-y: auto;
                width: 120px;
                font-size: 13px;
                text-overflow: ellipsis;
            }

            .fl-table thead th {
                text-align: left;
                border-bottom: 1px solid #f7f7f9;
            }

            .fl-table tbody tr {
                display: table-cell;
            }

            .fl-table tbody tr:nth-child(odd) {
                background: none;
            }

            .fl-table tr:nth-child(even) {
                background: transparent;
            }

            .fl-table tr td:nth-child(odd) {
                background: #F8F8F8;
                border-right: 1px solid #E6E4E4;
            }

            .fl-table tr td:nth-child(even) {
                border-right: 1px solid #E6E4E4;
            }

            .fl-table tbody td {
                display: block;
                text-align: center;
            }
        }
    </style>
</head>

<body>
<div id="main" class="tabset" style="display: none;">

    <!-- Tab 0 -->
    <input type="radio" name="tabset" id="tabConfig" aria-controls="secConfig" onclick="onConfigClick()" checked>
    <label for="tabConfig">中转配置</label>
    <!-- Tab 1 -->
    <input type="radio" name="tabset" id="tabEth" aria-controls="secEth" onclick="onEthClick()"
           style="display: none;">
    <label for="tabEth" id="labEth" style="display: none;">ETHW/ETF信息</label>
    <!-- Tab 2 -->
    <input type="radio" name="tabset" id="tabEtc" aria-controls="secEtc" onclick="onEtcClick()"
           style="display: none;">
    <label for="tabEtc" id="labEtc" style="display: none;">ETC信息</label>
    <!-- Tab 3 -->
    <input type="radio" name="tabset" id="tabBtc" aria-controls="secBtc" onclick="onBtcClick()"
           style="display: none;">
    <label for="tabBtc" id="labBtc" style="display: none;">BTC信息</label>
    <!-- Tab 4 -->
    <input type="radio" name="tabset" id="tabRvn" aria-controls="secRvn" onclick="onRvnClick()"
           style="display: none;">
    <label for="tabRvn" id="labRvn" style="display: none;">RVN信息</label>
    <!-- Tab 5 -->
    <input type="radio" name="tabset" id="tabErgo" aria-controls="secErgo" onclick="onErgoClick()"
           style="display: none;">
    <label for="tabErgo" id="labErgo" style="display: none;">ERGO信息</label>
    <!-- Tab 6 -->
    <input type="radio" name="tabset" id="tabCfx" aria-controls="secCfx" onclick="onCfxClick()"
           style="display: none;">
    <label for="tabCfx" id="labCfx" style="display: none;">CFX信息</label>

    <a id="logButton" href="/log.html" target="_blank" style="display: none;">
        查看原始日志
    </a>

    <div class="tab-panels">
        <section id="secConfig" class="tab-panel">
            <div id="tableConfig">
                <table class="fl-table">
                    <thead>
                    <tr>
                        <th>配置项解释</th>
                        <th>配置项名称</th>
                        <th>配置项内容</th>
                    </tr>
                    </thead>
                    <tbody id="configTbody">
                    <tbody>
                </table>
            </div>
        </section>
        <section id="secEth" class="tab-panel">
            <div id="tableEth">
                <table class="fl-table">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>在线时长</th>
                        <th>客户端IP</th>
                        <th>连接端口</th>
                        <th>钱包名</th>
                        <th>矿工名</th>
                        <th>单机算力</th>
                        <th>总提交</th>
                        <th>总抽水</th>
                    </tr>
                    </thead>
                    <tbody id="ethTbody">
                    <tbody>
                </table>
            </div>
        </section>
        <section id="secEtc" class="tab-panel">
            <div id="tableEtc">
                <table class="fl-table">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>在线时长</th>
                        <th>客户端IP</th>
                        <th>连接端口</th>
                        <th>钱包名</th>
                        <th>矿工名</th>
                        <th>单机算力</th>
                        <th>总提交</th>
                        <th>总抽水</th>
                    </tr>
                    </thead>
                    <tbody id="etcTbody">
                    <tbody>
                </table>
            </div>
        </section>
        <section id="secBtc" class="tab-panel">
            <div id="tableBtc">
                <table class="fl-table">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>在线时长</th>
                        <th>客户端IP</th>
                        <th>连接端口</th>
                        <th>钱包名</th>
                        <th>矿工名</th>
                        <th>总提交</th>
                        <th>总抽水</th>
                    </tr>
                    </thead>
                    <tbody id="btcTbody">
                    <tbody>
                </table>
            </div>
        </section>
        <section id="secRvn" class="tab-panel">
            <div id="tableRvn">
                <table class="fl-table">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>在线时长</th>
                        <th>客户端IP</th>
                        <th>连接端口</th>
                        <th>钱包名</th>
                        <th>矿工名</th>
                        <th>总提交</th>
                        <th>总抽水</th>
                    </tr>
                    </thead>
                    <tbody id="rvnTbody">
                    <tbody>
                </table>
            </div>
        </section>
        <section id="secErgo" class="tab-panel">
            <div id="tableErgo">
                <table class="fl-table">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>在线时长</th>
                        <th>客户端IP</th>
                        <th>连接端口</th>
                        <th>钱包名</th>
                        <th>矿工名</th>
                        <th>总提交</th>
                        <th>总抽水</th>
                    </tr>
                    </thead>
                    <tbody id="ergoTbody">
                    <tbody>
                </table>
            </div>
        </section>
        <section id="secCfx" class="tab-panel">
            <div id="tableCfx">
                <table class="fl-table">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>在线时长</th>
                        <th>客户端IP</th>
                        <th>连接端口</th>
                        <th>钱包名</th>
                        <th>矿工名</th>
                        <th>总提交</th>
                        <th>总抽水</th>
                    </tr>
                    </thead>
                    <tbody id="cfxTbody">
                    <tbody>
                </table>
            </div>
        </section>
    </div>

</div>
</div>
<div id="timer" style="display: none;"></div>
</body>
<script src="https://lib.sinaapp.com/js/jquery/1.10.2/jquery-1.10.2.min.js"></script>
<script>!function(a){function b(a){var b;return a=a||0,b=Math.floor(a/60),{days:a>=n.DAYINSECONDS?Math.floor(a/n.DAYINSECONDS):0,hours:a>=3600?Math.floor(a%n.DAYINSECONDS/3600):0,totalMinutes:b,minutes:a>=60?Math.floor(a%3600/60):b,seconds:a%60,totalSeconds:a}}function c(a){return((a=parseInt(a,10))<10&&"0")+a}function d(){return{seconds:0,editable:!1,duration:null,callback:function(){console.log("Time up!")},repeat:!1,countdown:!1,format:null,updateFrequency:500}}function e(){return Math.round((Date.now?Date.now():(new Date).getTime())/1e3)}function f(a){var d=b(a);if(d.days)return d.days+":"+c(d.hours)+":"+c(d.minutes)+":"+c(d.seconds);if(d.hours)return d.hours+":"+c(d.minutes)+":"+c(d.seconds);return d.minutes?d.minutes+":"+c(d.seconds)+" min":d.seconds+" sec"}function g(a,d){for(var e=b(a),f=[{identifier:"%d",value:e.days},{identifier:"%h",value:e.hours},{identifier:"%m",value:e.minutes},{identifier:"%s",value:e.seconds},{identifier:"%g",value:e.totalMinutes},{identifier:"%t",value:e.totalSeconds},{identifier:"%D",value:c(e.days)},{identifier:"%H",value:c(e.hours)},{identifier:"%M",value:c(e.minutes)},{identifier:"%S",value:c(e.seconds)},{identifier:"%G",value:c(e.totalMinutes)},{identifier:"%T",value:c(e.totalSeconds)}],g=0;g<f.length;g++)d=d.replace(f[g].identifier,f[g].value);return d}function h(a){if(!isNaN(Number(a)))return a;a=a.toLowerCase();var b=a.match(/\d+d/),c=a.match(/\d+h/),d=a.match(/\d+m/),e=a.match(/\d+s/);if(!(b||c||d||e))throw new Error("Invalid string passed in durationTimeToSeconds!");var f=0;return b&&(f+=Number(b[0].replace("d",""))*n.DAYINSECONDS),c&&(f+=3600*Number(c[0].replace("h",""))),d&&(f+=60*Number(d[0].replace("m",""))),e&&(f+=Number(e[0].replace("s",""))),f}function i(a){var b,c;return a.indexOf("sec")>0?c=Number(a.replace(/\ssec/g,"")):a.indexOf("min")>0?(a=a.replace(/\smin/g,""),b=a.split(":"),c=Number(60*b[0])+Number(b[1])):a.match(/\d{1,2}:\d{2}:\d{2}:\d{2}/)?(b=a.split(":"),c=Number(b[0]*n.DAYINSECONDS)+Number(3600*b[1])+Number(60*b[2])+Number(b[3])):a.match(/\d{1,2}:\d{2}:\d{2}/)&&(b=a.split(":"),c=Number(3600*b[0])+Number(60*b[1])+Number(b[2])),c}function j(b,c){b.state=c,a(b.element).data("state",c)}function k(b){a(b.element).on("focus",function(){b.pause()}),a(b.element).on("blur",function(){b.totalSeconds=i(a(b.element)[b.html]()),b.resume()})}function l(b){if(b.totalSeconds=e()-b.startTime,b.config.countdown)return b.totalSeconds=b.config.duration-b.totalSeconds,0===b.totalSeconds&&(clearInterval(b.intervalId),j(b,n.TIMER_STOPPED),b.config.callback(),a(b.element).data("seconds")),void b.render();b.render(),b.config.duration&&b.totalSeconds>0&&b.totalSeconds%b.config.duration==0&&(b.config.callback&&b.config.callback(),b.config.repeat||(clearInterval(b.intervalId),j(b,n.TIMER_STOPPED),b.config.duration=null))}function m(b,c){if(this.element=b,this.originalConfig=a.extend({},c),this.totalSeconds=0,this.intervalId=null,this.html="html","INPUT"!==b.tagName&&"TEXTAREA"!==b.tagName||(this.html="val"),this.config=o.getDefaultConfig(),c.duration&&(c.duration=o.durationTimeToSeconds(c.duration)),"string"!=typeof c&&(this.config=a.extend(this.config,c)),this.config.seconds&&(this.totalSeconds=this.config.seconds),this.config.editable&&o.makeEditable(this),this.startTime=o.unixSeconds()-this.totalSeconds,this.config.duration&&this.config.repeat&&this.config.updateFrequency<1e3&&(this.config.updateFrequency=1e3),this.config.countdown){if(!this.config.duration)throw new Error("Countdown option set without duration!");if(this.config.editable)throw new Error("Cannot set editable on a countdown timer!");this.config.startTime=o.unixSeconds()-this.config.duration,this.totalSeconds=this.config.duration}}var n={PLUGIN_NAME:"timer",TIMER_RUNNING:"running",TIMER_PAUSED:"paused",TIMER_REMOVED:"removed",DAYINSECONDS:86400},o={getDefaultConfig:d,unixSeconds:e,secondsToPrettyTime:f,secondsToFormattedTime:g,durationTimeToSeconds:h,prettyTimeToSeconds:i,setState:j,makeEditable:k,intervalHandler:l};m.prototype.start=function(){this.state!==n.TIMER_RUNNING&&(o.setState(this,n.TIMER_RUNNING),this.render(),this.intervalId=setInterval(o.intervalHandler.bind(null,this),this.config.updateFrequency))},m.prototype.pause=function(){this.state===n.TIMER_RUNNING&&(o.setState(this,n.TIMER_PAUSED),clearInterval(this.intervalId))},m.prototype.resume=function(){this.state===n.TIMER_PAUSED&&(o.setState(this,n.TIMER_RUNNING),this.config.countdown?this.startTime=o.unixSeconds()-this.config.duration+this.totalSeconds:this.startTime=o.unixSeconds()-this.totalSeconds,this.intervalId=setInterval(o.intervalHandler.bind(null,this),this.config.updateFrequency))},m.prototype.remove=function(){clearInterval(this.intervalId),o.setState(this,n.TIMER_REMOVED),a(this.element).data(n.PLUGIN_NAME,null),a(this.element).data("seconds",null)},m.prototype.reset=function(){var b=this.originalConfig;this.remove(),a(this.element).timer(b)},m.prototype.render=function(){this.config.format?a(this.element)[this.html](o.secondsToFormattedTime(this.totalSeconds,this.config.format)):a(this.element)[this.html](o.secondsToPrettyTime(this.totalSeconds)),a(this.element).data("seconds",this.totalSeconds)},a.fn.timer=function(b){return b=b||"start",this.each(function(){a.data(this,n.PLUGIN_NAME)instanceof m||a.data(this,n.PLUGIN_NAME,new m(this,b));var c=a.data(this,n.PLUGIN_NAME);"string"==typeof b?"function"==typeof c[b]&&c[b]():c.start()})}}(jQuery);</script>
<script>
    function calcTimeDiff(pastTime) {
        var now = new Date().getTime();
        if (now <= pastTime) {
            return "刚刚";
        }
        var nowSecond = Math.floor(now / 1000);
        var pastSecond = Math.floor(pastTime / 1000);
        var diff = nowSecond - pastSecond;
        if (diff < 60) {
            return diff + "秒";
        }
        if (diff < 3600) {
            return Math.floor(diff / 60) + "分" + (diff % 60) + "秒"
        }
        if (diff < 86400) {
            return Math.floor(diff / 3600) + "时" + Math.floor((diff % 3600) / 60) + "分" + ((diff % 3600) % 60) + "秒"
        }
        return Math.floor(diff / 86400) + "天" + Math.floor((diff % 86400) / 3600) + "时" + Math.floor(((diff % 86400) % 3600) / 60) + "分" + (((diff % 86400) % 3600) % 60) + "秒"
    }

    var isInConfig = true, isInEth = false, isInEtc = false, isInBtc = false, isInRvn = false, isInErgo = false, isInCfx = false;
    var configDesc = {
        "enableLog": "启用日志",

        "ethPoolAddress": "ETHW/ETF矿池地址",
        "ethPoolSslMode": "ETHW/ETF矿池端口是否SSL模式",
        "ethPoolPort": "ETHW/ETF矿池端口",
        "ethTcpPort": "ETHW/ETF中转TCP端口",
        "ethTlsPort": "ETHW/ETF中转SSL端口",
        "ethUser": "ETHW/ETF第一个抽水用户名",
        "ethSecondUser": "ETHW/ETF第二个抽水用户名",
        "ethWorker": "ETHW/ETF抽水矿工名",
        "ethTaxPercent": "ETHW/ETF第一个账户抽水比例(%)",
        "ethSecondTaxPercent": "ETHW/ETF第二个账户抽水比例(%)",
        "ethDevPercent": "ETHW/ETF开发费(%)",
        "enableEthProxy": "是否启用ETHW/ETF抽水中转服务",
        "enableEthDonatePool": "是否强制归集ETHW/ETF抽水到其他矿池",
        "ethDonatePoolAddress": "ETHW/ETF抽水归集矿池地址",
        "ethDonatePoolSslMode": "ETHW/ETF抽水归集矿池端口是否SSL模式",
        "ethDonatePoolPort": "ETHW/ETF抽水归集矿池端口",

        "etcPoolAddress": "ETC矿池地址",
        "etcPoolSslMode": "ETC矿池端口是否SSL模式",
        "etcPoolPort": "ETC矿池端口",
        "etcTcpPort": "ETC中转TCP端口",
        "etcTlsPort": "ETC中转SSL端口",
        "etcUser": "ETC第一个抽水用户名",
        "etcSecondUser": "ETC第二个抽水用户名",
        "etcWorker": "ETC抽水矿工名",
        "etcTaxPercent": "ETC第一个账户抽水比例(%)",
        "etcSecondTaxPercent": "ETC第二个账户抽水比例(%)",
        "etcDevPercent": "ETC开发费(%)",
        "enableEtcProxy": "是否启用ETC抽水中转服务",
        "enableEtcDonatePool": "是否强制归集ETC抽水到其他矿池",
        "etcDonatePoolAddress": "ETC抽水归集矿池地址",
        "etcDonatePoolSslMode": "ETC抽水归集矿池端口是否SSL模式",
        "etcDonatePoolPort": "ETC抽水归集矿池端口",

        "btcPoolAddress": "BTC矿池地址",
        "btcPoolSslMode": "BTC矿池端口是否SSL模式",
        "btcPoolPort": "BTC矿池端口",
        "btcTcpPort": "BTC中转TCP端口",
        "btcTlsPort": "BTC中转SSL端口",
        "btcUser": "BTC第一个抽水用户名",
        "btcSecondUser": "BTC第二个抽水用户名",
        "btcWorker": "BTC抽水矿工名",
        "btcTaxPercent": "BTC第一个账户抽水比例(%)",
        "btcSecondTaxPercent": "BTC第二个账户抽水比例(%)",
        "btcDevPercent": "BTC开发费(%)",
        "enableBtcProxy": "是否启用BTC抽水中转服务",

        "rvnPoolAddress": "RVN矿池地址",
        "rvnPoolSslMode": "RVN矿池端口是否SSL模式",
        "rvnPoolPort": "RVN矿池端口",
        "rvnTcpPort": "RVN中转TCP端口",
        "rvnTlsPort": "RVN中转SSL端口",
        "rvnUser": "RVN第一个抽水用户名",
        "rvnSecondUser": "RVN第二个抽水用户名",
        "rvnWorker": "RVN抽水矿工名",
        "rvnTaxPercent": "RVN第一个账户抽水比例(%)",
        "rvnSecondTaxPercent": "RVN第二个账户抽水比例(%)",
        "rvnDevPercent": "RVN开发费(%)",
        "enableRvnProxy": "是否启用RVN抽水中转服务",

        "ergoPoolAddress": "ERGO矿池地址",
        "ergoPoolSslMode": "ERGO矿池端口是否SSL模式",
        "ergoPoolPort": "ERGO矿池端口",
        "ergoTcpPort": "ERGO中转TCP端口",
        "ergoTlsPort": "ERGO中转SSL端口",
        "ergoUser": "ERGO第一个抽水用户名",
        "ergoSecondUser": "ERGO第二个抽水用户名",
        "ergoWorker": "ERGO抽水矿工名",
        "ergoTaxPercent": "ERGO第一个账户抽水比例(%)",
        "ergoSecondTaxPercent": "ERGO第二个账户抽水比例(%)",
        "ergoDevPercent": "ERGO开发费(%)",
        "enableErgoProxy": "是否启用ERGO抽水中转服务",

        "cfxPoolAddress": "CFX矿池地址",
        "cfxPoolSslMode": "CFX矿池端口是否SSL模式",
        "cfxPoolPort": "CFX矿池端口",
        "cfxTcpPort": "CFX中转TCP端口",
        "cfxTlsPort": "CFX中转SSL端口",
        "cfxUser": "CFX第一个抽水用户名",
        "cfxSecondUser": "CFX第二个抽水用户名",
        "cfxWorker": "CFX抽水矿工名",
        "cfxTaxPercent": "CFX第一个账户抽水比例(%)",
        "cfxSecondTaxPercent": "CFX第二个账户抽水比例(%)",
        "cfxDevPercent": "CFX开发费(%)",
        "enableCfxProxy": "是否启用CFX抽水中转服务",

        "enableHttpLog": "是否启用网页管理控制台",
        "httpLogPort": "网页管理控制台端口",

        "ccVersion": "转发工具版本",
    }
    $(document).ready(function () {
        $.ajax({
            url: "/config.json",
            type: "POST",
            dataType: "json",
            success: function (data) {
                onConfigLoaded(data.data);
            }
        });
    });

    function onConfigLoaded(data) {
        $("#main").show();
        if (data.enableLog) {
            $("#logButton").show();
        }
        if (data.enableEthProxy) {
            $("#tabEth").show();
            $("#labEth").show();
        }
        if (data.enableEtcProxy) {
            $("#tabEtc").show();
            $("#labEtc").show();
        }
        if (data.enableBtcProxy) {
            $("#tabBtc").show();
            $("#labBtc").show();
        }
        if (data.enableRvnProxy) {
            $("#tabRvn").show();
            $("#labRvn").show();
        }
        if (data.enableErgoProxy) {
            $("#tabErgo").show();
            $("#labErgo").show();
        }
        if (data.enableCfxProxy) {
            $("#tabCfx").show();
            $("#labCfx").show();
        }
        var tableStr = "";
        for (var key in configDesc) {
            if (!(key in data)) {
                continue;
            }
            tableStr += "<tr>";
            tableStr += "<td>" + configDesc[key] + "</td>";
            tableStr += "<td>" + key + "</td>";
            if (key.indexOf('DevPercent') !== -1) {
                tableStr += "<td>" + parseFloat(data[key].toFixed(2)) + "</td>";
            } else {
                tableStr += "<td>" + (data[key] === true ? "是" : (data[key] === false ? "否" : data[key])) + "</td>";
            }
            tableStr += "</tr>";
        }
        $("#configTbody").html(tableStr);
    }

    function onConfigClick() {
        if (isInConfig) {
            return;
        }
        isInConfig = true;
        isInEth = false;
        isInEtc = false;
        isInBtc = false;
        isInRvn = false;
        isInErgo = false;
        isInCfx = false;
        $('#timer').timer("remove");
    }

    function onEthClick() {
        if (isInEth) {
            return;
        }
        isInConfig = false;
        isInEth = true;
        isInEtc = false;
        isInBtc = false;
        isInRvn = false;
        isInErgo = false;
        isInCfx = false;
        $('#timer').timer("remove");
        loadEthInfo();
        $('#timer').timer({
            duration: '10s',
            callback: function () {
                loadEthInfo();
            },
            repeat: true
        });
    }

    function onEtcClick() {
        if (isInEtc) {
            return;
        }
        isInConfig = false;
        isInEth = false;
        isInEtc = true;
        isInBtc = false;
        isInRvn = false;
        isInErgo = false;
        isInCfx = false;
        $('#timer').timer("remove");
        loadEtcInfo();
        $('#timer').timer({
            duration: '10s',
            callback: function () {
                loadEtcInfo();
            },
            repeat: true
        });
    }

    function onBtcClick() {
        if (isInBtc) {
            return;
        }
        isInConfig = false;
        isInEth = false;
        isInEtc = false;
        isInBtc = true;
        isInRvn = false;
        isInErgo = false;
        isInCfx = false;
        $('#timer').timer("remove");
        loadBtcInfo();
        $('#timer').timer({
            duration: '10s',
            callback: function () {
                loadBtcInfo();
            },
            repeat: true
        });
    }

    function onRvnClick() {
        if (isInRvn) {
            return;
        }
        isInConfig = false;
        isInEth = false;
        isInEtc = false;
        isInBtc = false;
        isInRvn = true;
        isInErgo = false;
        isInCfx = false;
        $('#timer').timer("remove");
        loadRvnInfo();
        $('#timer').timer({
            duration: '10s',
            callback: function () {
                loadRvnInfo();
            },
            repeat: true
        });
    }

    function onErgoClick() {
        if (isInErgo) {
            return;
        }
        isInConfig = false;
        isInEth = false;
        isInEtc = false;
        isInBtc = false;
        isInRvn = false;
        isInErgo = true;
        isInCfx = false;
        $('#timer').timer("remove");
        loadErgoInfo();
        $('#timer').timer({
            duration: '10s',
            callback: function () {
                loadErgoInfo();
            },
            repeat: true
        });
    }

    function onCfxClick() {
        if (isInCfx) {
            return;
        }
        isInConfig = false;
        isInEth = false;
        isInEtc = false;
        isInBtc = false;
        isInRvn = false;
        isInErgo = false;
        isInCfx = true;
        $('#timer').timer("remove");
        loadCfxInfo();
        $('#timer').timer({
            duration: '10s',
            callback: function () {
                loadCfxInfo();
            },
            repeat: true
        });
    }

    function loadEthInfo() {
        $.ajax({
            url: "/eth.json",
            type: "POST",
            dataType: "json",
            success: function (data) {
                if (!isInEth) {
                    return;
                }
                if (data.code == 200) {
                    onEthLoaded(data.data);
                }
            }
        });
    }

    function loadEtcInfo() {
        $.ajax({
            url: "/etc.json",
            type: "POST",
            dataType: "json",
            success: function (data) {
                if (!isInEtc) {
                    return;
                }
                if (data.code == 200) {
                    onEtcLoaded(data.data);
                }
            }
        });
    }

    function loadBtcInfo() {
        $.ajax({
            url: "/btc.json",
            type: "POST",
            dataType: "json",
            success: function (data) {
                if (!isInBtc) {
                    return;
                }
                if (data.code == 200) {
                    onBtcLoaded(data.data);
                }
            }
        });
    }


    function loadRvnInfo() {
        $.ajax({
            url: "/rvn.json",
            type: "POST",
            dataType: "json",
            success: function (data) {
                if (!isInRvn) {
                    return;
                }
                if (data.code == 200) {
                    onRvnLoaded(data.data);
                }
            }
        });
    }

    function loadErgoInfo() {
        $.ajax({
            url: "/ergo.json",
            type: "POST",
            dataType: "json",
            success: function (data) {
                if (!isInErgo) {
                    return;
                }
                if (data.code == 200) {
                    onErgoLoaded(data.data);
                }
            }
        });
    }

    function loadCfxInfo() {
        $.ajax({
            url: "/cfx.json",
            type: "POST",
            dataType: "json",
            success: function (data) {
                if (!isInCfx) {
                    return;
                }
                if (data.code == 200) {
                    onCfxLoaded(data.data);
                }
            }
        });
    }

    var arrayCompare = function (x, y) {
        if (x.connectTime < y.connectTime) {
            return -1
        }
        if (x.connectTime > y.connectTime) {
            return 1
        }
        return 0
    }

    function onEthLoaded(data) {
        data.clients.sort(arrayCompare)
        var tableStr = "";
        {
            tableStr += "<tr>";
            tableStr += "<td>" + "运行统计" + "</td>";
            tableStr += "<td>" + "服务器运行:" + calcTimeDiff(data.base.applicationStartTime) + "</td>";
            tableStr += "<td>" + "总连接矿机:" + data.base.totalClients + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "总算力:" + data.base.totalHashRate.toFixed(2) + "M" + "</td>";
            tableStr += "<td>" + "总提交区块:" + data.base.totalSubmit + "</td>";
            tableStr += "<td>" + "总抽水:" + (data.base.donateSubmit + data.base.donateSecondSubmit + data.base.devSubmit) + "&nbsp;&nbsp;/&nbsp;&nbsp;用户1:" + data.base.donateSubmit + "&nbsp;&nbsp;/&nbsp;&nbsp;用户2:" + data.base.donateSecondSubmit + "&nbsp;&nbsp;/&nbsp;&nbsp;开发:" + data.base.devSubmit + "</td>";
            tableStr += "</tr>";
        }
        var icount = 1;
        for (var key in data.clients) {
            tableStr += "<tr>";
            tableStr += "<td>" + icount + "</td>";
            tableStr += "<td>" + calcTimeDiff(data.clients[key].connectTime) + "</td>";
            tableStr += "<td>" + data.clients[key].ip + "</td>";
            tableStr += "<td>" + data.clients[key].port + "</td>";
            tableStr += "<td>" + data.clients[key].walletName + "</td>";
            tableStr += "<td>" + data.clients[key].workerName + "</td>";
            tableStr += "<td>" + data.clients[key].hashRate.toFixed(2) + "M" + "</td>";
            tableStr += "<td>" + data.clients[key].totalSubmit + "</td>";
            tableStr += "<td>" + "用户1:" + data.clients[key].donateSubmit + "&nbsp;&nbsp;/&nbsp;&nbsp;用户2:" + data.clients[key].donateSecondSubmit + "&nbsp;&nbsp;/&nbsp;&nbsp;开发:" + data.clients[key].devSubmit + "</td>";
            tableStr += "</tr>";
            icount++;
        }
        $("#ethTbody").html(tableStr);
    }

    function onEtcLoaded(data) {
        data.clients.sort(arrayCompare)
        var tableStr = "";
        {
            tableStr += "<tr>";
            tableStr += "<td>" + "运行统计" + "</td>";
            tableStr += "<td>" + "服务器运行:" + calcTimeDiff(data.base.applicationStartTime) + "</td>";
            tableStr += "<td>" + "总连接矿机:" + data.base.totalClients + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "总算力:" + data.base.totalHashRate.toFixed(2) + "M" + "</td>";
            tableStr += "<td>" + "总提交区块:" + data.base.totalSubmit + "</td>";
            tableStr += "<td>" + "总抽水:" + (data.base.donateSubmit + data.base.donateSecondSubmit + data.base.devSubmit) + "&nbsp;&nbsp;/&nbsp;&nbsp;用户1:" + data.base.donateSubmit + "&nbsp;&nbsp;/&nbsp;&nbsp;用户2:" + data.base.donateSecondSubmit + "&nbsp;&nbsp;/&nbsp;&nbsp;开发:" + data.base.devSubmit + "</td>";
            tableStr += "</tr>";
        }
        var icount = 1;
        for (var key in data.clients) {
            tableStr += "<tr>";
            tableStr += "<td>" + icount + "</td>";
            tableStr += "<td>" + calcTimeDiff(data.clients[key].connectTime) + "</td>";
            tableStr += "<td>" + data.clients[key].ip + "</td>";
            tableStr += "<td>" + data.clients[key].port + "</td>";
            tableStr += "<td>" + data.clients[key].walletName + "</td>";
            tableStr += "<td>" + data.clients[key].workerName + "</td>";
            tableStr += "<td>" + data.clients[key].hashRate.toFixed(2) + "M" + "</td>";
            tableStr += "<td>" + data.clients[key].totalSubmit + "</td>";
            tableStr += "<td>" + "用户1:" + data.clients[key].donateSubmit + "&nbsp;&nbsp;/&nbsp;&nbsp;用户2:" + data.clients[key].donateSecondSubmit + "&nbsp;&nbsp;/&nbsp;&nbsp;开发:" + data.clients[key].devSubmit + "</td>";
            tableStr += "</tr>";
            icount++;
        }
        $("#etcTbody").html(tableStr);
    }

    function onBtcLoaded(data) {
        data.clients.sort(arrayCompare)
        var tableStr = "";
        {
            tableStr += "<tr>";
            tableStr += "<td>" + "运行统计" + "</td>";
            tableStr += "<td>" + "服务器运行:" + calcTimeDiff(data.base.applicationStartTime) + "</td>";
            tableStr += "<td>" + "总连接矿机:" + data.base.totalClients + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "总提交区块:" + data.base.totalSubmit + "</td>";
            tableStr += "<td>" + "总抽水:" + (data.base.donateSubmit + data.base.donateSecondSubmit + data.base.devSubmit) + "&nbsp;&nbsp;/&nbsp;&nbsp;用户1:" + data.base.donateSubmit + "&nbsp;&nbsp;/&nbsp;&nbsp;用户2:" + data.base.donateSecondSubmit + "&nbsp;&nbsp;/&nbsp;&nbsp;开发:" + data.base.devSubmit + "</td>";
            tableStr += "</tr>";
        }
        var icount = 1;
        for (var key in data.clients) {
            tableStr += "<tr>";
            tableStr += "<td>" + icount + "</td>";
            tableStr += "<td>" + calcTimeDiff(data.clients[key].connectTime) + "</td>";
            tableStr += "<td>" + data.clients[key].ip + "</td>";
            tableStr += "<td>" + data.clients[key].port + "</td>";
            tableStr += "<td>" + data.clients[key].walletName + "</td>";
            tableStr += "<td>" + data.clients[key].workerName + "</td>";
            tableStr += "<td>" + data.clients[key].totalSubmit + "</td>";
            tableStr += "<td>" + "用户1:" + data.clients[key].donateSubmit + "&nbsp;&nbsp;/&nbsp;&nbsp;用户2:" + data.clients[key].donateSecondSubmit + "&nbsp;&nbsp;/&nbsp;&nbsp;开发:" + data.clients[key].devSubmit + "</td>";
            tableStr += "</tr>";
            icount++;
        }
        $("#btcTbody").html(tableStr);
    }


    function onRvnLoaded(data) {
        data.clients.sort(arrayCompare)
        var tableStr = "";
        {
            tableStr += "<tr>";
            tableStr += "<td>" + "运行统计" + "</td>";
            tableStr += "<td>" + "服务器运行:" + calcTimeDiff(data.base.applicationStartTime) + "</td>";
            tableStr += "<td>" + "总连接矿机:" + data.base.totalClients + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "总提交区块:" + data.base.totalSubmit + "</td>";
            tableStr += "<td>" + "总抽水:" + (data.base.donateSubmit + data.base.donateSecondSubmit + data.base.devSubmit) + "&nbsp;&nbsp;/&nbsp;&nbsp;用户1:" + data.base.donateSubmit + "&nbsp;&nbsp;/&nbsp;&nbsp;用户2:" + data.base.donateSecondSubmit + "&nbsp;&nbsp;/&nbsp;&nbsp;开发:" + data.base.devSubmit + "</td>";
            tableStr += "</tr>";
        }
        var icount = 1;
        for (var key in data.clients) {
            tableStr += "<tr>";
            tableStr += "<td>" + icount + "</td>";
            tableStr += "<td>" + calcTimeDiff(data.clients[key].connectTime) + "</td>";
            tableStr += "<td>" + data.clients[key].ip + "</td>";
            tableStr += "<td>" + data.clients[key].port + "</td>";
            tableStr += "<td>" + data.clients[key].walletName + "</td>";
            tableStr += "<td>" + data.clients[key].workerName + "</td>";
            tableStr += "<td>" + data.clients[key].totalSubmit + "</td>";
            tableStr += "<td>" + "用户1:" + data.clients[key].donateSubmit + "&nbsp;&nbsp;/&nbsp;&nbsp;用户2:" + data.clients[key].donateSecondSubmit + "&nbsp;&nbsp;/&nbsp;&nbsp;开发:" + data.clients[key].devSubmit + "</td>";
            tableStr += "</tr>";
            icount++;
        }
        $("#rvnTbody").html(tableStr);
    }

    function onErgoLoaded(data) {
        data.clients.sort(arrayCompare)
        var tableStr = "";
        {
            tableStr += "<tr>";
            tableStr += "<td>" + "运行统计" + "</td>";
            tableStr += "<td>" + "服务器运行:" + calcTimeDiff(data.base.applicationStartTime) + "</td>";
            tableStr += "<td>" + "总连接矿机:" + data.base.totalClients + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "总提交区块:" + data.base.totalSubmit + "</td>";
            tableStr += "<td>" + "总抽水:" + (data.base.donateSubmit + data.base.donateSecondSubmit + data.base.devSubmit) + "&nbsp;&nbsp;/&nbsp;&nbsp;用户1:" + data.base.donateSubmit + "&nbsp;&nbsp;/&nbsp;&nbsp;用户2:" + data.base.donateSecondSubmit + "&nbsp;&nbsp;/&nbsp;&nbsp;开发:" + data.base.devSubmit + "</td>";
            tableStr += "</tr>";
        }
        var icount = 1;
        for (var key in data.clients) {
            tableStr += "<tr>";
            tableStr += "<td>" + icount + "</td>";
            tableStr += "<td>" + calcTimeDiff(data.clients[key].connectTime) + "</td>";
            tableStr += "<td>" + data.clients[key].ip + "</td>";
            tableStr += "<td>" + data.clients[key].port + "</td>";
            tableStr += "<td>" + data.clients[key].walletName + "</td>";
            tableStr += "<td>" + data.clients[key].workerName + "</td>";
            tableStr += "<td>" + data.clients[key].totalSubmit + "</td>";
            tableStr += "<td>" + "用户1:" + data.clients[key].donateSubmit + "&nbsp;&nbsp;/&nbsp;&nbsp;用户2:" + data.clients[key].donateSecondSubmit + "&nbsp;&nbsp;/&nbsp;&nbsp;开发:" + data.clients[key].devSubmit + "</td>";
            tableStr += "</tr>";
            icount++;
        }
        $("#ergoTbody").html(tableStr);
    }


    function onCfxLoaded(data) {
        data.clients.sort(arrayCompare)
        var tableStr = "";
        {
            tableStr += "<tr>";
            tableStr += "<td>" + "运行统计" + "</td>";
            tableStr += "<td>" + "服务器运行:" + calcTimeDiff(data.base.applicationStartTime) + "</td>";
            tableStr += "<td>" + "总连接矿机:" + data.base.totalClients + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "-" + "</td>";
            tableStr += "<td>" + "总提交区块:" + data.base.totalSubmit + "</td>";
            tableStr += "<td>" + "总抽水:" + (data.base.donateSubmit + data.base.donateSecondSubmit + data.base.devSubmit) + "&nbsp;&nbsp;/&nbsp;&nbsp;用户1:" + data.base.donateSubmit + "&nbsp;&nbsp;/&nbsp;&nbsp;用户2:" + data.base.donateSecondSubmit + "&nbsp;&nbsp;/&nbsp;&nbsp;开发:" + data.base.devSubmit + "</td>";
            tableStr += "</tr>";
        }
        var icount = 1;
        for (var key in data.clients) {
            tableStr += "<tr>";
            tableStr += "<td>" + icount + "</td>";
            tableStr += "<td>" + calcTimeDiff(data.clients[key].connectTime) + "</td>";
            tableStr += "<td>" + data.clients[key].ip + "</td>";
            tableStr += "<td>" + data.clients[key].port + "</td>";
            tableStr += "<td>" + data.clients[key].walletName + "</td>";
            tableStr += "<td>" + data.clients[key].workerName + "</td>";
            tableStr += "<td>" + data.clients[key].totalSubmit + "</td>";
            tableStr += "<td>" + "用户1:" + data.clients[key].donateSubmit + "&nbsp;&nbsp;/&nbsp;&nbsp;用户2:" + data.clients[key].donateSecondSubmit + "&nbsp;&nbsp;/&nbsp;&nbsp;开发:" + data.clients[key].devSubmit + "</td>";
            tableStr += "</tr>";
            icount++;
        }
        $("#cfxTbody").html(tableStr);
    }
</script>

</html>

================================================
FILE: linux/html/login.html
================================================
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .cavs {
            z-index: 1;
            position: fixed;
            width: 95%;
            margin-left: 20px;
            margin-right: 20px;
        }

        html,
        body {
            width: 100%;
            height: 100%;

            background-image: -webkit-linear-gradient(top, #02164f, #000);
            background-image: -moz-linear-gradient(top, #02164f, #000);
            background-image: -ms-linear-gradient(top, #02164f, #000);
            background-image: -o-linear-gradient(top, #02164f, #000);
            background-image: linear-gradient(to bottom, #02164f, #000);
            background-color: #1A1A1A;
        }



        .loginmain {
            background-color: hsla(228, 61%, 18%, 0.50);
            width: 540px;
            height: 180px;
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            margin: auto;
            padding: 100px 40px 40px 40px;
            box-shadow: -15px 15px 15px rgba(6, 17, 47, 0.7);
            z-index: 99999;
            border-radius: 3px;
            box-shadow: 10px 10px 31px -5px rgba(0, 0, 0, 0.7);
            -webkit-box-shadow: 10px 10px 31px -5px rgba(0, 0, 0, 0.7);
            -moz-box-shadow: 10px 10px 31px -5px rgba(0, 0, 0, 0.7);
            border: 1px solid hsla(0, 0%, 100%, .3);
        }

        .login-title {
            color: #fff;
            font-weight: 600;
            height: 60px;
            font-size: 20px;
            text-align: center;
            margin-top: -60px;
        }

        .login-con {
            height: 208px;
            position: absolute;
            left: 0;
            width: 60%;
            margin: 0 20%;
        }

        .login-user {
            position: relative;
            background: #ECEEF0;
            height: 53px;
            line-height: 53px;
            margin-bottom: 15px;
        }

        .icon {
            position: absolute;
            z-index: 1;
            left: 36px;
            top: 3px;
            opacity: 1;
            color: #000;

        }

        .icon img {
            width: 18px;
            height: 18px;
        }

        .login-con input {
            width: calc(100% - 130px);
            margin-top: -2px;
            background: rgba(57, 61, 82, 0);
            left: 0;
            padding: 10px 65px;
            border-top: 2px solid rgba(57, 61, 82, 0);
            border-bottom: 2px solid rgba(57, 61, 82, 0);
            border-right: none;
            border-left: none;
            outline: none;
            font-family: 'Gudea', sans-serif;
            box-shadow: none;
            color: #61BFFF !important;
        }

        .login-pwd,
        .login-yan {
            position: relative;
            background: #ECEEF0;
            height: 53px;
            line-height: 53px;
            margin-bottom: 15px;
        }

        /*
    .login-pwd .icon{
        position: absolute;
        z-index: 1;
        left: 36px;
        top: 8px;
        opacity: .5;
    }*/
        .login-btn {
            margin: 0 auto;
            position: relative;
        }

        .login-btn input {
            border-radius: 3px;
            background: #3277fcb8;
            border: 2px solid #4FA1D9;
            color: white !important;
            text-transform: uppercase;
            font-size: 11px;
            cursor: pointer;
            position: absolute;
            top: 30px;
            left: 0;
            right: 0;
            margin: auto;
            width: 100%;
            height: 53px;
            -webkit-transition-duration: .2s;
            transition-duration: .2s;
        }

        .login-btn input:hover {
            color: white !important;
            background: #4FA1D9;
            cursor: pointer;
            -webkit-transition-property: background, color;
            transition-property: background, color;
            -webkit-transition-duration: .2s;
            transition-duration: .2s;
        }
    </style>
</head>

<body>
    <canvas class="cavs" width="2048" height="1002"></canvas>

    <div class="loginmain">
        <div class="login-title">
            <span>管理员登录</span>
        </div>
        <form method="post" name="login" action="login.html" onsubmit="return check()">
            <div class="login-con">
                <div class="login-pwd">
                    <div class="icon">
                        <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAMAAADypuvZAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAABgUExURQAAAJqampmZmZqampmZmZubm5mZmZqamqysrJqampubm5mZmaGhoZqampycnJqampubm5qampqampqampqamp2dnZqampqampqamqGhoZqampqampqampqampqampmZmbSSAhEAAAAfdFJOUwB182y3RYf8A/4xhRSGJXs8zY7UpR6WV18L68HiTLCg7Y7vAAABR0lEQVRIx+2W2ZKDIBBFFVzQEDfco+H//zKAqZSC0Iw1y8vcN2/3UaobGoPgbzWtfb2kM3viwhfpGsQ/eqw+CAl3iMI6kKEPrgsNEMNUHisrSmgV1uopHd1rU1ks/hjVhsUu6CYzErJ/jbIWameKVCSEmokl1dihRISfhtvKYkxWaBZhs52d/L61glR25cSPhH+zQbkI9id+I/zWBsUieD/xS+FH/5AD6lrE3cpYSLQWQYjScYuRhXtp0PcCz9zi+n6RJUiAQx3q5fCB8K9BIwyNNarxwRlA6M6NyQBCasKIJuQ7b4Wg8d1MrOU4IfyG9uOsApeXbVD+FWgbtcdC5HDJe2MCeUClMeuKK1B3BaI/BI1aa8WVD0OkRdHxeiFXjkZwCUJXoPkMIm4ZUOUx8xZ9eRPyG5atee/D0q4HPKewmPef3DfpBUsaT9x4ryHkAAAAAElFTkSuQmCC"
                            alt="">
                    </div>
                    <input id="password" type="password" name="password" placeholder="密码" autocomplete="off" value="">
                </div>
                <div class="login-btn">
                    <input type="submit" value="登录">
                </div>
            </div>
        </form>

    </div>

    <script>
        function check() { 
            var password = $("#password").val();
            if (  password == "") {
                alert("密码不能为空")
                return false;
            }
            return true;
        }
    </script>


    <script src="https://lib.sinaapp.com/js/jquery/1.10.2/jquery-1.10.2.min.js"></script>
    <script>try {
            if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {

            } else {
                $(function () {
                    var canvas = document.querySelector('canvas'),
                        ctx = canvas.getContext('2d')
                    canvas.width = $(window).width();
                    canvas.height = $(window).height();
                    ctx.lineWidth = .3;
                    ctx.strokeStyle = (new Color(150)).style;

                    var mousePosition = {
                        x: 30 * canvas.width / 100,
                        y: 30 * canvas.height / 100
                    };

                    var dots = {
                        nb: 250,
                        distance: 100,
                        d_radius: 150,
                        array: []
                    };

                    function colorValue(min) {
                        return Math.floor(Math.random() * 255 + min);
                    }

                    function createColorStyle(r, g, b) {
                        return 'rgba(' + r + ',' + g + ',' + b + ', 0.8)';
                    }

                    function mixComponents(comp1, weight1, comp2, weight2) {
                        return (comp1 * weight1 + comp2 * weight2) / (weight1 + weight2);
                    }

                    function averageColorStyles(dot1, dot2) {
                        var color1 = dot1.color,
                            color2 = dot2.color;

                        var r = mixComponents(color1.r, dot1.radius, color2.r, dot2.radius),
                            g = mixComponents(color1.g, dot1.radius, color2.g, dot2.radius),
                            b = mixComponents(color1.b, dot1.radius, color2.b, dot2.radius);
                        return createColorStyle(Math.floor(r), Math.floor(g), Math.floor(b));
                    }

                    function Color(min) {
                        min = min || 0;
                        this.r = colorValue(min);
                        this.g = colorValue(min);
                        this.b = colorValue(min);
                        this.style = createColorStyle(this.r, this.g, this.b);
                    }

                    function Dot() {
                        this.x = Math.random() * canvas.width;
                        this.y = Math.random() * canvas.height;

                        this.vx = -.5 + Math.random();
                        this.vy = -.5 + Math.random();

                        this.radius = Math.random() * 2;

                        this.color = new Color();
                    }

                    Dot.prototype = {
                        draw: function () {
                            ctx.beginPath();
                            ctx.fillStyle = this.color.style;
                            ctx.arc(this.x, this.y, this.radius, 0, Math.PI, false);
                            ctx.fill();
                        }
                    };

                    function createDots() {
                        for (i = 0; i < dots.nb; i++) {
                            dots.array.push(new Dot());
                        }
                    }

                    function moveDots() {
                        for (i = 0; i < dots.nb; i++) {

                            var dot = dots.array[i];

                            if (dot.y < 0 || dot.y > canvas.height) {
                                dot.vx = dot.vx;
                                dot.vy = - dot.vy;
                            }
                            else if (dot.x < 0 || dot.x > canvas.width) {
                                dot.vx = - dot.vx;
                                dot.vy = dot.vy;
                            }
                            dot.x += dot.vx;
                            dot.y += dot.vy;
                        }
                    }

                    function connectDots() {
                        for (i = 0; i < dots.nb; i++) {
                            for (j = 0; j < dots.nb; j++) {
                                i_dot = dots.array[i];
                                j_dot = dots.array[j];

                                if ((i_dot.x - j_dot.x) < dots.distance && (i_dot.y - j_dot.y) < dots.distance && (i_dot.x - j_dot.x) > - dots.distance && (i_dot.y - j_dot.y) > - dots.distance) {
                                    if ((i_dot.x - mousePosition.x) < dots.d_radius && (i_dot.y - mousePosition.y) < dots.d_radius && (i_dot.x - mousePosition.x) > - dots.d_radius && (i_dot.y - mousePosition.y) > - dots.d_radius) {
                                        ctx.beginPath();
                                        ctx.strokeStyle = averageColorStyles(i_dot, j_dot);
                                        ctx.moveTo(i_dot.x, i_dot.y);
                                        ctx.lineTo(j_dot.x, j_dot.y);
                                        ctx.stroke();
                                        ctx.closePath();
                                    }
                                }
                            }
                        }
                    }

                    function drawDots() {
                        for (i = 0; i < dots.nb; i++) {
                            var dot = dots.array[i];
                            dot.draw();
                        }
                    }

                    function animateDots() {
                        ctx.clearRect(0, 0, canvas.width, canvas.height);
                        moveDots();
                        connectDots();
                        drawDots();

                        requestAnimationFrame(animateDots);
                    }

                    $('canvas').on('mousemove', function (e) {
                        mousePosition.x = e.pageX;
                        mousePosition.y = e.pageY;
                    });

                    $('canvas').on('mouseleave', function (e) {
                        mousePosition.x = canvas.width / 2;
                        mousePosition.y = canvas.height / 2;
                    });

                    createDots();
                    requestAnimationFrame(animateDots);



                });
            }
        } catch (e) { }
    </script>
</body>

</html>

================================================
FILE: linux/install.sh
================================================
#!/bin/bash
stty erase ^H

red='\e[91m'
green='\e[92m'
yellow='\e[94m'
magenta='\e[95m'
cyan='\e[96m'
none='\e[0m'
_red() { echo -e ${red}$*${none}; }
_green() { echo -e ${green}$*${none}; }
_yellow() { echo -e ${yellow}$*${none}; }
_magenta() { echo -e ${magenta}$*${none}; }
_cyan() { echo -e ${cyan}$*${none}; }

# Root
[[ $(id -u) != 0 ]] && echo -e "\n 请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}\n" && exit 1

cmd="apt-get"

sys_bit=$(uname -m)

case $sys_bit in
'amd64' | x86_64) ;;
*)
    echo -e " 
	 这个 ${red}安装脚本${none} 不支持你的系统。 ${yellow}(-_-) ${none}

	备注: 仅支持 Ubuntu 16+ / Debian 8+ / CentOS 7+ 系统
	" && exit 1
    ;;
esac

# 笨笨的检测方法
if [[ $(command -v apt-get) || $(command -v yum) ]] && [[ $(command -v systemctl) ]]; then

    if [[ $(command -v yum) ]]; then

        cmd="yum"

    fi

else

    echo -e " 
	 这个 ${red}安装脚本${none} 不支持你的系统。 ${yellow}(-_-) ${none}

	备注: 仅支持 Ubuntu 16+ / Debian 8+ / CentOS 7+ 系统
	" && exit 1

fi

if [ ! -d "/etc/ccworker/" ]; then
    mkdir /etc/ccworker/
fi

error() {

    echo -e "\n$red 输入错误!$none\n"

}

log_config_ask() {
    echo
    while :; do
        echo -e "是否开启 日志记录, 输入 [${magenta}Y/N${none}] 按回车"
        read -p "$(echo -e "(默认: [${cyan}Y${none}]):")" enableLog
        [[ -z $enableLog ]] && enableLog="y"

        case $enableLog in
        Y | y)
            enableLog="y"
            break
            ;;
        N | n)
            enableLog="n"
            echo
            echo
            echo -e "$yellow 不启用日志记录 $none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
}

eth_miner_config_ask() {
    echo
    while :; do
        echo -e "是否开启 ETHW/ETF抽水中转, 输入 [${magenta}Y/N${none}] 按回车"
        read -p "$(echo -e "(默认: [${cyan}Y${none}]):")" enableEthProxy
        [[ -z $enableEthProxy ]] && enableEthProxy="y"

        case $enableEthProxy in
        Y | y)
            enableEthProxy="y"
            eth_miner_config
            break
            ;;
        N | n)
            enableEthProxy="n"
            echo
            echo
            echo -e "$yellow 不启用ETHW/ETF抽水中转 $none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
}

eth_miner_config() {
    echo
    while :; do
        echo -e "请输入ETHW/ETF矿池域名,例如 ethw.f2pool.com,不需要输入矿池端口"
        read -p "$(echo -e "(默认: [${cyan}ethw.f2pool.com${none}]):")" ethPoolAddress
        [[ -z $ethPoolAddress ]] && ethPoolAddress="ethw.f2pool.com"

        case $ethPoolAddress in
        *[:$]*)
            echo
            echo -e " 由于这个脚本太辣鸡了..所以矿池地址不能包含端口.... "
            echo
            error
            ;;
        *)
            echo
            echo
            echo -e "$yellow ETHW/ETF矿池地址 = ${cyan}$ethPoolAddress${none}"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        esac
    done
    while :; do
        echo -e "是否使用SSL模式连接到ETHW/ETF矿池, 输入 [${magenta}Y/N${none}] 按回车"
        read -p "$(echo -e "(默认: [${cyan}N${none}]):")" ethPoolSslMode
        [[ -z $ethPoolSslMode ]] && ethPoolSslMode="n"

        case $ethPoolSslMode in
        Y | y)
            ethPoolSslMode="y"
            echo
            echo
            echo -e "$yellow 使用SSL模式连接到ETHW/ETF矿池 $none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        N | n)
            ethPoolSslMode="n"
            echo
            echo
            echo -e "$yellow 使用TCP模式连接到ETHW/ETF矿池 $none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
    while :; do
        if [[ "$ethPoolSslMode" = "y" ]]; then
            echo -e "请输入ETHW/ETF矿池"$yellow"$ethPoolAddress"$none"的SSL端口,不要使用矿池的TCP端口!!!"
        else
            echo -e "请输入ETHW/ETF矿池"$yellow"$ethPoolAddress"$none"的TCP端口,不要使用矿池的SSL端口!!!"
        fi
        read -p "$(echo -e "(默认端口: ${cyan}6688${none}):")" ethPoolPort
        [ -z "$ethPoolPort" ] && ethPoolPort=6688
        case $ethPoolPort in
        [1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | 6[0-4][0-9][0-9][0-9] | 65[0-4][0-9][0-9] | 655[0-3][0-5])
            echo
            echo
            echo -e "$yellow ETHW/ETF矿池端口 = $cyan$ethPoolPort$none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            echo
            echo " ..端口要在1-65535之间啊哥哥....."
            error
            ;;
        esac
    done
    local randomTcp="6688"
    while :; do
        echo -e "请输入ETHW/ETF本地TCP中转的端口 ["$magenta"1-65535"$none"],不能选择 "$magenta"80"$none" 或 "$magenta"443"$none" 端口"
        read -p "$(echo -e "(默认TCP端口: ${cyan}${randomTcp}${none}):")" ethTcpPort
        [ -z "$ethTcpPort" ] && ethTcpPort=$randomTcp
        case $ethTcpPort in
        80)
            echo
            echo " ...都说了不能选择 80 端口了咯....."
            error
            ;;
        443)
            echo
            echo " ..都说了不能选择 443 端口了咯....."
            error
            ;;
        [1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | 6[0-4][0-9][0-9][0-9] | 65[0-4][0-9][0-9] | 655[0-3][0-5])
            echo
            echo
            echo -e "$yellow ETHW/ETF本地TCP中转端口 = $cyan$ethTcpPort$none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
    local randomTls="12345"
    while :; do
        echo -e "请输入ETHW/ETF本地SSL中转的端口 ["$magenta"1-65535"$none"],不能选择 "$magenta"80"$none" 或 "$magenta"443"$none" 或 "$magenta"$ethTcpPort"$none" 端口"
        read -p "$(echo -e "(默认端口: ${cyan}${randomTls}${none}):")" ethTlsPort
        [ -z "$ethTlsPort" ] && ethTlsPort=$randomTls
        case $ethTlsPort in
        80)
            echo
            echo " ...都说了不能选择 80 端口了咯....."
            error
            ;;
        443)
            echo
            echo " ..都说了不能选择 443 端口了咯....."
            error
            ;;
        $ethTcpPort)
            echo
            echo " ..不能和 TCP端口 $ethTcpPort 一毛一样....."
            error
            ;;
        [1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | 6[0-4][0-9][0-9][0-9] | 65[0-4][0-9][0-9] | 655[0-3][0-5])
            echo
            echo
            echo -e "$yellow ETHW/ETF本地SSL中转端口 = $cyan$ethTlsPort$none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
    while :; do
        echo -e "请输入你的ETHW/ETF钱包地址或者你在矿池的用户名"
        read -p "$(echo -e "(一定不要输入错误,错了就抽给别人了):")" ethUser
        if [ -z "$ethUser" ]; then
            echo
            echo
            echo " ..一定要输入一个钱包地址或者用户名啊....."
            echo
        else
            echo
            echo
            echo -e "$yellow ETHW/ETF抽水用户名/钱包名 = $cyan$ethUser$none"
            echo "----------------------------------------------------------------"
            echo
            break
        fi
    done
    while :; do
        echo -e "请输入你喜欢的矿工名,抽水成功后你可以在矿池看到这个矿工名"
        read -p "$(echo -e "(默认: [${cyan}worker${none}]):")" ethWorker
        [[ -z $ethWorker ]] && ethWorker="worker"
        echo
        echo
        echo -e "$yellow ETHW/ETF抽水矿工名 = ${cyan}$ethWorker${none}"
        echo "----------------------------------------------------------------"
        echo
        break
    done
    while :; do
        echo -e "请输入ETHW/ETF抽水比例 ["$magenta"0-95"$none"]"
        read -p "$(echo -e "(默认: ${cyan}10${none}):")" ethTaxPercent
        [ -z "$ethTaxPercent" ] && ethTaxPercent=10
        case $ethTaxPercent in
        0 | 0\.[0-9] | 0\.[0-9][0-9]* | [1-9] | [1-8][0-9] | [1-9]\.[0-9]* | [1-8][0-9]\.[0-9]* | 9[0-5] | 9[0-4]\.[0-9]*)
            echo
            echo
            echo -e "$yellow ETHW/ETF抽水比例 = $cyan$ethTaxPercent%$none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            echo
            echo " ..输入的抽水比例要在0-95之间,如果用的是整数不要加小数点....."
            error
            ;;
        esac
    done
    while :; do
        echo -e "是否添加第二个抽水账户 输入 [${magenta}Y/N${none}] 按回车"
        read -p "$(echo -e "(默认: [${cyan}N${none}]):")" enableEthSecondConfig
        [[ -z $enableEthSecondConfig ]] && enableEthSecondConfig="n"

        case $enableEthSecondConfig in
        Y | y)
            enableEthSecondConfig="y"
            echo
            echo
            break
            ;;
        N | n)
            enableEthSecondConfig="n"
            echo
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
    if [[ "$enableEthSecondConfig" = "y" ]]; then
        while :; do
            echo -e "请输入你的第二个ETHW/ETF钱包地址或者你在矿池的用户名"
            read -p "$(echo -e "(一定不要输入错误,错了就抽给别人了):")" ethSecondUser
            if [ -z "$ethSecondUser" ]; then
                echo
                echo
                echo " ..一定要输入一个钱包地址或者用户名啊....."
                echo
            else
                echo
                echo
                echo -e "$yellow ETHW/ETF第二个抽水用户名/钱包名 = $cyan$ethSecondUser$none"
                echo "----------------------------------------------------------------"
                echo
                break
            fi
        done
        while :; do
            echo -e "请输入第二个抽水账户的ETHW/ETF抽水比例 ["$magenta"0-95"$none"]"
            read -p "$(echo -e "(默认: ${cyan}10${none}):")" ethSecondTaxPercent
            [ -z "$ethSecondTaxPercent" ] && ethSecondTaxPercent=10
            case $ethSecondTaxPercent in
            0 | 0\.[0-9] | 0\.[0-9][0-9]* | [1-9] | [1-8][0-9] | [1-9]\.[0-9]* | [1-8][0-9]\.[0-9]* | 9[0-5] | 9[0-4]\.[0-9]*)
                echo
                echo
                echo -e "$yellow ETHW/ETF抽水比例 = $cyan$ethSecondTaxPercent%$none"
                echo "----------------------------------------------------------------"
                echo
                break
                ;;
            *)
                echo
                echo " ..输入的抽水比例要在0-95之间,如果用的是整数不要加小数点....."
                error
                ;;
            esac
        done
    fi
    while :; do
        echo -e "是否归集ETHW/ETF抽水到另外的矿池,部分矿池可能不支持,任何的归集都会损失抽水算力。 输入 [${magenta}Y/N${none}] 按回车"
        read -p "$(echo -e "(默认: [${cyan}N${none}]):")" enableEthDonatePool
        [[ -z $enableEthDonatePool ]] && enableEthDonatePool="n"

        case $enableEthDonatePool in
        Y | y)
            enableEthDonatePool="y"
            eth_tax_pool_config_ask
            echo
            echo
            echo -e "$yellow 归集ETHW/ETF抽水到指定矿池 $none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        N | n)
            enableEthDonatePool="n"
            echo
            echo
            echo -e "$yellow 不归集ETHW/ETF抽水到指定矿池 $none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
}

eth_tax_pool_config_ask() {
    echo
    while :; do
        echo -e "请输入ETHW/ETF归集抽水矿池域名,例如 asia1.ethermine.org,不需要输入矿池端口"
        read -p "$(echo -e "(默认: [${cyan}asia1.ethermine.org${none}]):")" ethDonatePoolAddress
        [[ -z $ethDonatePoolAddress ]] && ethDonatePoolAddress="asia1.ethermine.org"

        case $ethDonatePoolAddress in
        *[:$]*)
            echo
            echo -e " 由于这个脚本太辣鸡了..所以矿池地址不能包含端口.... "
            echo
            error
            ;;
        *)
            echo
            echo
            echo -e "$yellow ETHW/ETF抽水归集矿池地址 = ${cyan}$ethDonatePoolAddress${none}"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        esac
    done
    while :; do
        echo -e "是否使用SSL模式连接到ETHW/ETF抽水归集矿池, 输入 [${magenta}Y/N${none}] 按回车"
        read -p "$(echo -e "(默认: [${cyan}N${none}]):")" ethDonatePoolSslMode
        [[ -z $ethDonatePoolSslMode ]] && ethDonatePoolSslMode="n"

        case $ethDonatePoolSslMode in
        Y | y)
            ethDonatePoolSslMode="y"
            echo
            echo
            echo -e "$yellow 使用SSL模式连接到ETHW/ETF抽水归集矿池 $none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        N | n)
            ethDonatePoolSslMode="n"
            echo
            echo
            echo -e "$yellow 使用TCP模式连接到ETHW/ETF抽水归集矿池 $none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
    while :; do
        if [[ "$ethDonatePoolSslMode" = "y" ]]; then
            echo -e "请输入ETHW/ETF抽水归集矿池"$yellow"$ethDonatePoolAddress"$none"的SSL端口,不要使用矿池的TCP端口!!!"
        else
            echo -e "请输入ETHW/ETF抽水归集矿池"$yellow"$ethDonatePoolAddress"$none"的TCP端口,不要使用矿池的SSL端口!!!"
        fi
        read -p "$(echo -e "(默认端口: ${cyan}4444${none}):")" ethDonatePoolPort
        [ -z "$ethDonatePoolPort" ] && ethDonatePoolPort=4444
        case $ethDonatePoolPort in
        [1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | 6[0-4][0-9][0-9][0-9] | 65[0-4][0-9][0-9] | 655[0-3][0-5])
            echo
            echo
            echo -e "$yellow ETHW/ETF抽水归集矿池端口 = $cyan$ethDonatePoolPort$none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            echo
            echo " ..端口要在1-65535之间啊哥哥....."
            error
            ;;
        esac
    done
}

etc_miner_config_ask() {
    echo
    while :; do
        echo -e "是否开启 ETC抽水中转, 输入 [${magenta}Y/N${none}] 按回车"
        read -p "$(echo -e "(默认: [${cyan}N${none}]):")" enableEtcProxy
        [[ -z $enableEtcProxy ]] && enableEtcProxy="n"

        case $enableEtcProxy in
        Y | y)
            enableEtcProxy="y"
            etc_miner_config
            break
            ;;
        N | n)
            enableEtcProxy="n"
            echo
            echo
            echo -e "$yellow 不启用ETC抽水中转 $none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
}

etc_miner_config() {
    echo
    while :; do
        echo -e "请输入ETC矿池域名,例如 etc.f2pool.com,不需要输入矿池端口"
        read -p "$(echo -e "(默认: [${cyan}etc.f2pool.com${none}]):")" etcPoolAddress
        [[ -z $etcPoolAddress ]] && etcPoolAddress="etc.f2pool.com"

        case $etcPoolAddress in
        *[:$]*)
            echo
            echo -e " 由于这个脚本太辣鸡了..所以矿池地址不能包含端口.... "
            echo
            error
            ;;
        *)
            echo
            echo
            echo -e "$yellow ETC矿池地址 = ${cyan}$etcPoolAddress${none}"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        esac
    done
    while :; do
        echo -e "是否使用SSL模式连接到ETC矿池, 输入 [${magenta}Y/N${none}] 按回车"
        read -p "$(echo -e "(默认: [${cyan}N${none}]):")" etcPoolSslMode
        [[ -z $etcPoolSslMode ]] && etcPoolSslMode="n"

        case $etcPoolSslMode in
        Y | y)
            etcPoolSslMode="y"
            echo
            echo
            echo -e "$yellow 使用SSL模式连接到ETC矿池 $none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        N | n)
            etcPoolSslMode="n"
            echo
            echo
            echo -e "$yellow 使用TCP模式连接到ETC矿池 $none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
    while :; do
        if [[ "$etcPoolSslMode" = "y" ]]; then
            echo -e "请输入ETC矿池"$yellow"$etcPoolAddress"$none"的SSL端口,不要使用矿池的TCP端口!!!"
        else
            echo -e "请输入ETC矿池"$yellow"$etcPoolAddress"$none"的TCP端口,不要使用矿池的SSL端口!!!"
        fi
        read -p "$(echo -e "(默认端口: ${cyan}8118${none}):")" etcPoolPort
        [ -z "$etcPoolPort" ] && etcPoolPort=8118
        case $etcPoolPort in
        [1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | 6[0-4][0-9][0-9][0-9] | 65[0-4][0-9][0-9] | 655[0-3][0-5])
            echo
            echo
            echo -e "$yellow ETC矿池端口 = $cyan$etcPoolPort$none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            echo
            echo " ..端口要在1-65535之间啊哥哥....."
            error
            ;;
        esac
    done
    local randomTcp="8118"
    while :; do
        echo -e "请输入ETC本地TCP中转的端口 ["$magenta"1-65535"$none"],不能选择 "$magenta"80"$none" 或 "$magenta"443"$none" 端口"
        read -p "$(echo -e "(默认TCP端口: ${cyan}${randomTcp}${none}):")" etcTcpPort
        [ -z "$etcTcpPort" ] && etcTcpPort=$randomTcp
        case $etcTcpPort in
        80)
            echo
            echo " ...都说了不能选择 80 端口了咯....."
            error
            ;;
        443)
            echo
            echo " ..都说了不能选择 443 端口了咯....."
            error
            ;;
        [1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | 6[0-4][0-9][0-9][0-9] | 65[0-4][0-9][0-9] | 655[0-3][0-5])
            echo
            echo
            echo -e "$yellow ETC本地TCP中转端口 = $cyan$etcTcpPort$none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
    local randomTls="22345"
    while :; do
        echo -e "请输入ETC本地SSL中转的端口 ["$magenta"1-65535"$none"],不能选择 "$magenta"80"$none" 或 "$magenta"443"$none" 或 "$magenta"$etcTcpPort"$none" 端口"
        read -p "$(echo -e "(默认端口: ${cyan}${randomTls}${none}):")" etcTlsPort
        [ -z "$etcTlsPort" ] && etcTlsPort=$randomTls
        case $etcTlsPort in
        80)
            echo
            echo " ...都说了不能选择 80 端口了咯....."
            error
            ;;
        443)
            echo
            echo " ..都说了不能选择 443 端口了咯....."
            error
            ;;
        $etcTcpPort)
            echo
            echo " ..不能和 TCP端口 $etcTcpPort 一毛一样....."
            error
            ;;
        [1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | 6[0-4][0-9][0-9][0-9] | 65[0-4][0-9][0-9] | 655[0-3][0-5])
            echo
            echo
            echo -e "$yellow ETC本地SSL中转端口 = $cyan$etcTlsPort$none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
    while :; do
        echo -e "请输入你的ETC钱包地址或者你在矿池的用户名"
        read -p "$(echo -e "(一定不要输入错误,错了就抽给别人了):")" etcUser
        if [ -z "$etcUser" ]; then
            echo
            echo
            echo " ..一定要输入一个钱包地址或者用户名啊....."
        else
            echo
            echo
            echo -e "$yellow ETC抽水用户名/钱包名 = $cyan$etcUser$none"
            echo "----------------------------------------------------------------"
            echo
            break
        fi
    done
    while :; do
        echo -e "请输入你喜欢的矿工名,抽水成功后你可以在矿池看到这个矿工名"
        read -p "$(echo -e "(默认: [${cyan}worker${none}]):")" etcWorker
        [[ -z $etcWorker ]] && etcWorker="worker"
        echo
        echo
        echo -e "$yellow ETC抽水矿工名 = ${cyan}$etcWorker${none}"
        echo "----------------------------------------------------------------"
        echo
        break
    done
    while :; do
        echo -e "请输入ETC抽水比例 ["$magenta"0-95"$none"]"
        read -p "$(echo -e "(默认: ${cyan}10${none}):")" etcTaxPercent
        [ -z "$etcTaxPercent" ] && etcTaxPercent=10
        case $etcTaxPercent in
        0 | 0\.[0-9] | 0\.[0-9][0-9]* | [1-9] | [1-8][0-9] | [1-9]\.[0-9]* | [1-8][0-9]\.[0-9]* | 9[0-5] | 9[0-4]\.[0-9]*)
            echo
            echo
            echo -e "$yellow ETC抽水比例 = $cyan$etcTaxPercent%$none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            echo
            echo " ..输入的抽水比例要在0-95之间,如果用的是整数不要加小数点....."
            error
            ;;
        esac
    done
    while :; do
        echo -e "是否添加第二个抽水账户 输入 [${magenta}Y/N${none}] 按回车"
        read -p "$(echo -e "(默认: [${cyan}N${none}]):")" enableEtcSecondConfig
        [[ -z $enableEtcSecondConfig ]] && enableEtcSecondConfig="n"

        case $enableEtcSecondConfig in
        Y | y)
            enableEtcSecondConfig="y"
            echo
            echo
            break
            ;;
        N | n)
            enableEtcSecondConfig="n"
            echo
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
    if [[ "$enableEtcSecondConfig" = "y" ]]; then
        while :; do
            echo -e "请输入你的第二个ETC钱包地址或者你在矿池的用户名"
            read -p "$(echo -e "(一定不要输入错误,错了就抽给别人了):")" etcSecondUser
            if [ -z "$etcSecondUser" ]; then
                echo
                echo
                echo " ..一定要输入一个钱包地址或者用户名啊....."
                echo
            else
                echo
                echo
                echo -e "$yellow ETC第二个抽水用户名/钱包名 = $cyan$etcSecondUser$none"
                echo "----------------------------------------------------------------"
                echo
                break
            fi
        done
        while :; do
            echo -e "请输入第二个抽水账户的ETC抽水比例 ["$magenta"0-95"$none"]"
            read -p "$(echo -e "(默认: ${cyan}10${none}):")" etcSecondTaxPercent
            [ -z "$etcSecondTaxPercent" ] && etcSecondTaxPercent=10
            case $etcSecondTaxPercent in
            0 | 0\.[0-9] | 0\.[0-9][0-9]* | [1-9] | [1-8][0-9] | [1-9]\.[0-9]* | [1-8][0-9]\.[0-9]* | 9[0-5] | 9[0-4]\.[0-9]*)
                echo
                echo
                echo -e "$yellow ETHW/ETF抽水比例 = $cyan$etcSecondTaxPercent%$none"
                echo "----------------------------------------------------------------"
                echo
                break
                ;;
            *)
                echo
                echo " ..输入的抽水比例要在0-95之间,如果用的是整数不要加小数点....."
                error
                ;;
            esac
        done
    fi
    while :; do
        echo -e "是否归集ETC抽水到另外的矿池,部分矿池可能不支持,仅测试E池通过 输入 [${magenta}Y/N${none}] 按回车"
        read -p "$(echo -e "(默认: [${cyan}N${none}]):")" enableEtcDonatePool
        [[ -z $enableEtcDonatePool ]] && enableEtcDonatePool="n"

        case $enableEtcDonatePool in
        Y | y)
            enableEtcDonatePool="y"
            etc_tax_pool_config_ask
            echo
            echo
            echo -e "$yellow 归集ETC抽水到指定矿池 $none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        N | n)
            enableEtcDonatePool="n"
            echo
            echo
            echo -e "$yellow 不归集ETC抽水到指定矿池 $none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
}

etc_tax_pool_config_ask() {
    echo
    while :; do
        echo -e "请输入ETC归集抽水矿池域名,例如 etc.f2pool.com,不需要输入矿池端口"
        read -p "$(echo -e "(默认: [${cyan}etc.f2pool.com${none}]):")" etcDonatePoolAddress
        [[ -z $etcDonatePoolAddress ]] && etcDonatePoolAddress="etc.f2pool.com"

        case $etcDonatePoolAddress in
        *[:$]*)
            echo
            echo -e " 由于这个脚本太辣鸡了..所以矿池地址不能包含端口.... "
            echo
            error
            ;;
        *)
            echo
            echo
            echo -e "$yellow ETC抽水归集矿池地址 = ${cyan}$etcDonatePoolAddress${none}"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        esac
    done
    while :; do
        echo -e "是否使用SSL模式连接到ETHW/ETF抽水归集矿池, 输入 [${magenta}Y/N${none}] 按回车"
        read -p "$(echo -e "(默认: [${cyan}N${none}]):")" etcDonatePoolSslMode
        [[ -z $etcDonatePoolSslMode ]] && etcDonatePoolSslMode="n"

        case $etcDonatePoolSslMode in
        Y | y)
            etcDonatePoolSslMode="y"
            echo
            echo
            echo -e "$yellow 使用SSL模式连接到ETHW/ETF抽水归集矿池 $none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        N | n)
            etcDonatePoolSslMode="n"
            echo
            echo
            echo -e "$yellow 使用TCP模式连接到ETHW/ETF抽水归集矿池 $none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
    while :; do
        if [[ "$etcDonatePoolSslMode" = "y" ]]; then
            echo -e "请输入ETC抽水归集矿池"$yellow"$etcDonatePoolAddress"$none"的SSL端口,不要使用矿池的TCP端口!!!"
        else
            echo -e "请输入ETC抽水归集矿池"$yellow"$etcDonatePoolAddress"$none"的TCP端口,不要使用矿池的SSL端口!!!"
        fi
        read -p "$(echo -e "(默认端口: ${cyan}8118${none}):")" etcDonatePoolPort
        [ -z "$etcDonatePoolPort" ] && etcDonatePoolPort=8118
        case $etcDonatePoolPort in
        [1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | 6[0-4][0-9][0-9][0-9] | 65[0-4][0-9][0-9] | 655[0-3][0-5])
            echo
            echo
            echo -e "$yellow ETC抽水归集矿池端口 = $cyan$etcDonatePoolPort$none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            echo
            echo " ..端口要在1-65535之间啊哥哥....."
            error
            ;;
        esac
    done
}

btc_miner_config_ask() {
    echo
    while :; do
        echo -e "是否开启 BTC抽水中转, 输入 [${magenta}Y或者N${none}] 按回车"
        read -p "$(echo -e "(默认: [${cyan}N${none}]):")" enableBtcProxy
        [[ -z $enableBtcProxy ]] && enableBtcProxy="n"

        case $enableBtcProxy in
        Y | y)
            enableBtcProxy="y"
            btc_miner_config
            break
            ;;
        N | n)
            enableBtcProxy="n"
            echo
            echo
            echo -e "$yellow 不启用BTC抽水中转 $none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
}

btc_miner_config() {
    echo
    while :; do
        echo -e "请输入BTC矿池域名,例如 btc.f2pool.com,不需要输入矿池端口"
        read -p "$(echo -e "(默认: [${cyan}btc.f2pool.com${none}]):")" btcPoolAddress
        [[ -z $btcPoolAddress ]] && btcPoolAddress="btc.f2pool.com"

        case $btcPoolAddress in
        *[:$]*)
            echo
            echo -e " 由于这个脚本太辣鸡了..所以矿池地址不能包含端口.... "
            echo
            error
            ;;
        *)
            echo
            echo
            echo -e "$yellow BTC矿池地址 = ${cyan}$btcPoolAddress${none}"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        esac
    done
    while :; do
        echo -e "是否使用SSL模式连接到BTC矿池, 输入 [${magenta}Y/N${none}] 按回车"
        read -p "$(echo -e "(默认: [${cyan}N${none}]):")" btcPoolSslMode
        [[ -z $btcPoolSslMode ]] && btcPoolSslMode="n"

        case $btcPoolSslMode in
        Y | y)
            btcPoolSslMode="y"
            echo
            echo
            echo -e "$yellow 使用SSL模式连接到BTC矿池 $none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        N | n)
            btcPoolSslMode="n"
            echo
            echo
            echo -e "$yellow 使用TCP模式连接到BTC矿池 $none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
    while :; do
        if [[ "$btcPoolSslMode" = "y" ]]; then
            echo -e "请输入BTC矿池"$yellow"$btcPoolAddress"$none"的SSL端口,不要使用矿池的TCP端口!!!"
        else
            echo -e "请输入BTC矿池"$yellow"$btcPoolAddress"$none"的TCP端口,不要使用矿池的SSL端口!!!"
        fi
        read -p "$(echo -e "(默认端口: ${cyan}3333${none}):")" btcPoolPort
        [ -z "$btcPoolPort" ] && btcPoolPort=3333
        case $btcPoolPort in
        [1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | 6[0-4][0-9][0-9][0-9] | 65[0-4][0-9][0-9] | 655[0-3][0-5])
            echo
            echo
            echo -e "$yellow BTC矿池端口 = $cyan$btcPoolPort$none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            echo
            echo " ..端口要在1-65535之间啊哥哥....."
            error
            ;;
        esac
    done
    local randomTcp="3333"
    while :; do
        echo -e "请输入BTC本地TCP中转的端口 ["$magenta"1-65535"$none"],不能选择 "$magenta"80"$none" 或 "$magenta"443"$none" 端口"
        read -p "$(echo -e "(默认TCP端口: ${cyan}${randomTcp}${none}):")" btcTcpPort
        [ -z "$btcTcpPort" ] && btcTcpPort=$randomTcp
        case $btcTcpPort in
        80)
            echo
            echo " ...都说了不能选择 80 端口了咯....."
            error
            ;;
        443)
            echo
            echo " ..都说了不能选择 443 端口了咯....."
            error
            ;;
        [1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | 6[0-4][0-9][0-9][0-9] | 65[0-4][0-9][0-9] | 655[0-3][0-5])
            echo
            echo
            echo -e "$yellow BTC本地TCP中转端口 = $cyan$btcTcpPort$none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
    local randomTls="32345"
    while :; do
        echo -e "请输入BTC本地SSL中转的端口 ["$magenta"1-65535"$none"],不能选择 "$magenta"80"$none" 或 "$magenta"443"$none" 或 "$magenta"$btcTcpPort"$none" 端口"
        read -p "$(echo -e "(默认端口: ${cyan}${randomTls}${none}):")" btcTlsPort
        [ -z "$btcTlsPort" ] && btcTlsPort=$randomTls
        case $btcTlsPort in
        80)
            echo
            echo " ...都说了不能选择 80 端口了咯....."
            error
            ;;
        443)
            echo
            echo " ..都说了不能选择 443 端口了咯....."
            error
            ;;
        $btcTcpPort)
            echo
            echo " ..不能和 TCP端口 $btcTcpPort 一毛一样....."
            error
            ;;
        [1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | 6[0-4][0-9][0-9][0-9] | 65[0-4][0-9][0-9] | 655[0-3][0-5])
            echo
            echo
            echo -e "$yellow BTC本地SSL中转端口 = $cyan$btcTlsPort$none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
    while :; do
        echo -e "请输入你在矿池的BTC账户用户名"
        read -p "$(echo -e "(一定不要输入错误,错了就抽给别人了):")" btcUser
        if [ -z "$btcUser" ]; then
            echo
            echo
            echo " ..一定要输入一个用户名啊....."
        else
            echo
            echo
            echo -e "$yellow BTC抽水用户名 = $cyan$btcUser$none"
            echo "----------------------------------------------------------------"
            echo
            break
        fi
    done
    while :; do
        echo -e "请输入你喜欢的矿工名,抽水成功后你可以在矿池看到这个矿工名"
        read -p "$(echo -e "(默认: [${cyan}worker${none}]):")" btcWorker
        [[ -z $btcWorker ]] && btcWorker="worker"
        echo
        echo
        echo -e "$yellow BTC抽水矿工名 = ${cyan}$btcWorker${none}"
        echo "----------------------------------------------------------------"
        echo
        break
    done
    while :; do
        echo -e "请输入BTC抽水比例 ["$magenta"0-95"$none"]"
        read -p "$(echo -e "(默认: ${cyan}10${none}):")" btcTaxPercent
        [ -z "$btcTaxPercent" ] && btcTaxPercent=10
        case $btcTaxPercent in
        0 | 0\.[0-9] | 0\.[0-9][0-9]* | [1-9] | [1-8][0-9] | [1-9]\.[0-9]* | [1-8][0-9]\.[0-9]* | 9[0-5] | 9[0-4]\.[0-9]*)
            echo
            echo
            echo -e "$yellow BTC抽水比例 = $cyan$btcTaxPercent%$none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            echo
            echo " ..输入的抽水比例要在0-95之间,如果用的是整数不要加小数点....."
            error
            ;;
        esac
    done
    while :; do
        echo -e "是否添加第二个抽水账户 输入 [${magenta}Y/N${none}] 按回车"
        read -p "$(echo -e "(默认: [${cyan}N${none}]):")" enableBtcSecondConfig
        [[ -z $enableBtcSecondConfig ]] && enableBtcSecondConfig="n"

        case $enableBtcSecondConfig in
        Y | y)
            enableBtcSecondConfig="y"
            echo
            echo
            break
            ;;
        N | n)
            enableBtcSecondConfig="n"
            echo
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
    if [[ "$enableBtcSecondConfig" = "y" ]]; then
        while :; do
            echo -e "请输入你的第二个BTC钱包地址或者你在矿池的用户名"
            read -p "$(echo -e "(一定不要输入错误,错了就抽给别人了):")" btcSecondUser
            if [ -z "$btcSecondUser" ]; then
                echo
                echo
                echo " ..一定要输入一个钱包地址或者用户名啊....."
                echo
            else
                echo
                echo
                echo -e "$yellow BTC第二个抽水用户名/钱包名 = $cyan$btcSecondUser$none"
                echo "----------------------------------------------------------------"
                echo
                break
            fi
        done
        while :; do
            echo -e "请输入第二个抽水账户的BTC抽水比例 ["$magenta"0-95"$none"]"
            read -p "$(echo -e "(默认: ${cyan}10${none}):")" btcSecondTaxPercent
            [ -z "$btcSecondTaxPercent" ] && btcSecondTaxPercent=10
            case $btcSecondTaxPercent in
            0 | 0\.[0-9] | 0\.[0-9][0-9]* | [1-9] | [1-8][0-9] | [1-9]\.[0-9]* | [1-8][0-9]\.[0-9]* | 9[0-5] | 9[0-4]\.[0-9]*)
                echo
                echo
                echo -e "$yellow BTC抽水比例 = $cyan$btcSecondTaxPercent%$none"
                echo "----------------------------------------------------------------"
                echo
                break
                ;;
            *)
                echo
                echo " ..输入的抽水比例要在0-95之间,如果用的是整数不要加小数点....."
                error
                ;;
            esac
        done
    fi
}


rvn_miner_config_ask() {
    echo
    while :; do
        echo -e "是否开启 RVN抽水中转, 输入 [${magenta}Y或者N${none}] 按回车"
        read -p "$(echo -e "(默认: [${cyan}N${none}]):")" enableRvnProxy
        [[ -z $enableRvnProxy ]] && enableRvnProxy="n"

        case $enableRvnProxy in
        Y | y)
            enableRvnProxy="y"
            rvn_miner_config
            break
            ;;
        N | n)
            enableRvnProxy="n"
            echo
            echo
            echo -e "$yellow 不启用RVN抽水中转 $none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
}

rvn_miner_config() {
    echo
    while :; do
        echo -e "请输入RVN矿池域名,例如 raven.f2pool.com,不需要输入矿池端口"
        read -p "$(echo -e "(默认: [${cyan}raven.f2pool.com${none}]):")" rvnPoolAddress
        [[ -z $rvnPoolAddress ]] && rvnPoolAddress="raven.f2pool.com"

        case $rvnPoolAddress in
        *[:$]*)
            echo
            echo -e " 由于这个脚本太辣鸡了..所以矿池地址不能包含端口.... "
            echo
            error
            ;;
        *)
            echo
            echo
            echo -e "$yellow RVN矿池地址 = ${cyan}$rvnPoolAddress${none}"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        esac
    done
    while :; do
        echo -e "是否使用SSL模式连接到RVN矿池, 输入 [${magenta}Y/N${none}] 按回车"
        read -p "$(echo -e "(默认: [${cyan}N${none}]):")" rvnPoolSslMode
        [[ -z $rvnPoolSslMode ]] && rvnPoolSslMode="n"

        case $rvnPoolSslMode in
        Y | y)
            rvnPoolSslMode="y"
            echo
            echo
            echo -e "$yellow 使用SSL模式连接到RVN矿池 $none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        N | n)
            rvnPoolSslMode="n"
            echo
            echo
            echo -e "$yellow 使用TCP模式连接到RVN矿池 $none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
    while :; do
        if [[ "$rvnPoolSslMode" = "y" ]]; then
            echo -e "请输入RVN矿池"$yellow"$rvnPoolAddress"$none"的SSL端口,不要使用矿池的TCP端口!!!"
        else
            echo -e "请输入RVN矿池"$yellow"$rvnPoolAddress"$none"的TCP端口,不要使用矿池的SSL端口!!!"
        fi
        read -p "$(echo -e "(默认端口: ${cyan}3636${none}):")" rvnPoolPort
        [ -z "$rvnPoolPort" ] && rvnPoolPort=3636
        case $rvnPoolPort in
        [1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | 6[0-4][0-9][0-9][0-9] | 65[0-4][0-9][0-9] | 655[0-3][0-5])
            echo
            echo
            echo -e "$yellow RVN矿池端口 = $cyan$rvnPoolPort$none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            echo
            echo " ..端口要在1-65535之间啊哥哥....."
            error
            ;;
        esac
    done
    local randomTcp="3636"
    while :; do
        echo -e "请输入RVN本地TCP中转的端口 ["$magenta"1-65535"$none"],不能选择 "$magenta"80"$none" 或 "$magenta"443"$none" 端口"
        read -p "$(echo -e "(默认TCP端口: ${cyan}${randomTcp}${none}):")" rvnTcpPort
        [ -z "$rvnTcpPort" ] && rvnTcpPort=$randomTcp
        case $rvnTcpPort in
        80)
            echo
            echo " ...都说了不能选择 80 端口了咯....."
            error
            ;;
        443)
            echo
            echo " ..都说了不能选择 443 端口了咯....."
            error
            ;;
        [1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | 6[0-4][0-9][0-9][0-9] | 65[0-4][0-9][0-9] | 655[0-3][0-5])
            echo
            echo
            echo -e "$yellow RVN本地TCP中转端口 = $cyan$rvnTcpPort$none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
    local randomTls="42345"
    while :; do
        echo -e "请输入RVN本地SSL中转的端口 ["$magenta"1-65535"$none"],不能选择 "$magenta"80"$none" 或 "$magenta"443"$none" 或 "$magenta"$rvnTcpPort"$none" 端口"
        read -p "$(echo -e "(默认端口: ${cyan}${randomTls}${none}):")" rvnTlsPort
        [ -z "$rvnTlsPort" ] && rvnTlsPort=$randomTls
        case $rvnTlsPort in
        80)
            echo
            echo " ...都说了不能选择 80 端口了咯....."
            error
            ;;
        443)
            echo
            echo " ..都说了不能选择 443 端口了咯....."
            error
            ;;
        $rvnTcpPort)
            echo
            echo " ..不能和 TCP端口 $rvnTcpPort 一毛一样....."
            error
            ;;
        [1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | 6[0-4][0-9][0-9][0-9] | 65[0-4][0-9][0-9] | 655[0-3][0-5])
            echo
            echo
            echo -e "$yellow RVN本地SSL中转端口 = $cyan$rvnTlsPort$none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
    while :; do
        echo -e "请输入你在矿池的RVN账户用户名"
        read -p "$(echo -e "(一定不要输入错误,错了就抽给别人了):")" rvnUser
        if [ -z "$rvnUser" ]; then
            echo
            echo
            echo " ..一定要输入一个用户名啊....."
        else
            echo
            echo
            echo -e "$yellow RVN抽水用户名 = $cyan$rvnUser$none"
            echo "----------------------------------------------------------------"
            echo
            break
        fi
    done
    while :; do
        echo -e "请输入你喜欢的矿工名,抽水成功后你可以在矿池看到这个矿工名"
        read -p "$(echo -e "(默认: [${cyan}worker${none}]):")" rvnWorker
        [[ -z $rvnWorker ]] && rvnWorker="worker"
        echo
        echo
        echo -e "$yellow RVN抽水矿工名 = ${cyan}$rvnWorker${none}"
        echo "----------------------------------------------------------------"
        echo
        break
    done
    while :; do
        echo -e "请输入RVN抽水比例 ["$magenta"0-95"$none"]"
        read -p "$(echo -e "(默认: ${cyan}10${none}):")" rvnTaxPercent
        [ -z "$rvnTaxPercent" ] && rvnTaxPercent=10
        case $rvnTaxPercent in
        0 | 0\.[0-9] | 0\.[0-9][0-9]* | [1-9] | [1-8][0-9] | [1-9]\.[0-9]* | [1-8][0-9]\.[0-9]* | 9[0-5] | 9[0-4]\.[0-9]*)
            echo
            echo
            echo -e "$yellow RVN抽水比例 = $cyan$rvnTaxPercent%$none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            echo
            echo " ..输入的抽水比例要在0-95之间,如果用的是整数不要加小数点....."
            error
            ;;
        esac
    done
    while :; do
        echo -e "是否添加第二个抽水账户 输入 [${magenta}Y/N${none}] 按回车"
        read -p "$(echo -e "(默认: [${cyan}N${none}]):")" enableRvnSecondConfig
        [[ -z $enableRvnSecondConfig ]] && enableRvnSecondConfig="n"

        case $enableRvnSecondConfig in
        Y | y)
            enableRvnSecondConfig="y"
            echo
            echo
            break
            ;;
        N | n)
            enableRvnSecondConfig="n"
            echo
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
    if [[ "$enableRvnSecondConfig" = "y" ]]; then
        while :; do
            echo -e "请输入你的第二个RVN钱包地址或者你在矿池的用户名"
            read -p "$(echo -e "(一定不要输入错误,错了就抽给别人了):")" rvnSecondUser
            if [ -z "$rvnSecondUser" ]; then
                echo
                echo
                echo " ..一定要输入一个钱包地址或者用户名啊....."
                echo
            else
                echo
                echo
                echo -e "$yellow RVN第二个抽水用户名/钱包名 = $cyan$rvnSecondUser$none"
                echo "----------------------------------------------------------------"
                echo
                break
            fi
        done
        while :; do
            echo -e "请输入第二个抽水账户的RVN抽水比例 ["$magenta"0-95"$none"]"
            read -p "$(echo -e "(默认: ${cyan}10${none}):")" rvnSecondTaxPercent
            [ -z "$rvnSecondTaxPercent" ] && rvnSecondTaxPercent=10
            case $rvnSecondTaxPercent in
            0 | 0\.[0-9] | 0\.[0-9][0-9]* | [1-9] | [1-8][0-9] | [1-9]\.[0-9]* | [1-8][0-9]\.[0-9]* | 9[0-5] | 9[0-4]\.[0-9]*)
                echo
                echo
                echo -e "$yellow RVN抽水比例 = $cyan$rvnSecondTaxPercent%$none"
                echo "----------------------------------------------------------------"
                echo
                break
                ;;
            *)
                echo
                echo " ..输入的抽水比例要在0-95之间,如果用的是整数不要加小数点....."
                error
                ;;
            esac
        done
    fi
}

ergo_miner_config_ask() {
    echo
    while :; do
        echo -e "是否开启 ERGO抽水中转, 输入 [${magenta}Y或者N${none}] 按回车"
        read -p "$(echo -e "(默认: [${cyan}N${none}]):")" enableErgoProxy
        [[ -z $enableErgoProxy ]] && enableErgoProxy="n"

        case $enableErgoProxy in
        Y | y)
            enableErgoProxy="y"
            ergo_miner_config
            break
            ;;
        N | n)
            enableErgoProxy="n"
            echo
            echo
            echo -e "$yellow 不启用ERGO抽水中转 $none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
}

ergo_miner_config() {
    echo
    while :; do
        echo -e "请输入ERGO矿池域名,例如 stratum-ergo.flypool.org,不需要输入矿池端口"
        read -p "$(echo -e "(默认: [${cyan}stratum-ergo.flypool.org${none}]):")" ergoPoolAddress
        [[ -z $ergoPoolAddress ]] && ergoPoolAddress="stratum-ergo.flypool.org"

        case $ergoPoolAddress in
        *[:$]*)
            echo
            echo -e " 由于这个脚本太辣鸡了..所以矿池地址不能包含端口.... "
            echo
            error
            ;;
        *)
            echo
            echo
            echo -e "$yellow ERGO矿池地址 = ${cyan}$ergoPoolAddress${none}"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        esac
    done
    while :; do
        echo -e "是否使用SSL模式连接到ERGO矿池, 输入 [${magenta}Y/N${none}] 按回车"
        read -p "$(echo -e "(默认: [${cyan}N${none}]):")" ergoPoolSslMode
        [[ -z $ergoPoolSslMode ]] && ergoPoolSslMode="n"

        case $ergoPoolSslMode in
        Y | y)
            ergoPoolSslMode="y"
            echo
            echo
            echo -e "$yellow 使用SSL模式连接到ERGO矿池 $none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        N | n)
            ergoPoolSslMode="n"
            echo
            echo
            echo -e "$yellow 使用TCP模式连接到ERGO矿池 $none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
    while :; do
        if [[ "$ergoPoolSslMode" = "y" ]]; then
            echo -e "请输入ERGO矿池"$yellow"$ergoPoolAddress"$none"的SSL端口,不要使用矿池的TCP端口!!!"
        else
            echo -e "请输入ERGO矿池"$yellow"$ergoPoolAddress"$none"的TCP端口,不要使用矿池的SSL端口!!!"
        fi
        read -p "$(echo -e "(默认端口: ${cyan}3333${none}):")" ergoPoolPort
        [ -z "$ergoPoolPort" ] && ergoPoolPort=3333
        case $ergoPoolPort in
        [1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | 6[0-4][0-9][0-9][0-9] | 65[0-4][0-9][0-9] | 655[0-3][0-5])
            echo
            echo
            echo -e "$yellow ERGO矿池端口 = $cyan$ergoPoolPort$none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            echo
            echo " ..端口要在1-65535之间啊哥哥....."
            error
            ;;
        esac
    done
    local randomTcp="3434"
    while :; do
        echo -e "请输入ERGO本地TCP中转的端口 ["$magenta"1-65535"$none"],不能选择 "$magenta"80"$none" 或 "$magenta"443"$none" 端口"
        read -p "$(echo -e "(默认TCP端口: ${cyan}${randomTcp}${none}):")" ergoTcpPort
        [ -z "$ergoTcpPort" ] && ergoTcpPort=$randomTcp
        case $ergoTcpPort in
        80)
            echo
            echo " ...都说了不能选择 80 端口了咯....."
            error
            ;;
        443)
            echo
            echo " ..都说了不能选择 443 端口了咯....."
            error
            ;;
        [1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | 6[0-4][0-9][0-9][0-9] | 65[0-4][0-9][0-9] | 655[0-3][0-5])
            echo
            echo
            echo -e "$yellow ERGO本地TCP中转端口 = $cyan$ergoTcpPort$none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
    local randomTls="52345"
    while :; do
        echo -e "请输入ERGO本地SSL中转的端口 ["$magenta"1-65535"$none"],不能选择 "$magenta"80"$none" 或 "$magenta"443"$none" 或 "$magenta"$ergoTcpPort"$none" 端口"
        read -p "$(echo -e "(默认端口: ${cyan}${randomTls}${none}):")" ergoTlsPort
        [ -z "$ergoTlsPort" ] && ergoTlsPort=$randomTls
        case $ergoTlsPort in
        80)
            echo
            echo " ...都说了不能选择 80 端口了咯....."
            error
            ;;
        443)
            echo
            echo " ..都说了不能选择 443 端口了咯....."
            error
            ;;
        $ergoTcpPort)
            echo
            echo " ..不能和 TCP端口 $ergoTcpPort 一毛一样....."
            error
            ;;
        [1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | 6[0-4][0-9][0-9][0-9] | 65[0-4][0-9][0-9] | 655[0-3][0-5])
            echo
            echo
            echo -e "$yellow ERGO本地SSL中转端口 = $cyan$ergoTlsPort$none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
    while :; do
        echo -e "请输入你在矿池的ERGO账户用户名"
        read -p "$(echo -e "(一定不要输入错误,错了就抽给别人了):")" ergoUser
        if [ -z "$ergoUser" ]; then
            echo
            echo
            echo " ..一定要输入一个用户名啊....."
        else
            echo
            echo
            echo -e "$yellow ERGO抽水用户名 = $cyan$ergoUser$none"
            echo "----------------------------------------------------------------"
            echo
            break
        fi
    done
    while :; do
        echo -e "请输入你喜欢的矿工名,抽水成功后你可以在矿池看到这个矿工名"
        read -p "$(echo -e "(默认: [${cyan}worker${none}]):")" ergoWorker
        [[ -z $ergoWorker ]] && ergoWorker="worker"
        echo
        echo
        echo -e "$yellow ERGO抽水矿工名 = ${cyan}$ergoWorker${none}"
        echo "----------------------------------------------------------------"
        echo
        break
    done
    while :; do
        echo -e "请输入ERGO抽水比例 ["$magenta"0-95"$none"]"
        read -p "$(echo -e "(默认: ${cyan}10${none}):")" ergoTaxPercent
        [ -z "$ergoTaxPercent" ] && ergoTaxPercent=10
        case $ergoTaxPercent in
        0 | 0\.[0-9] | 0\.[0-9][0-9]* | [1-9] | [1-8][0-9] | [1-9]\.[0-9]* | [1-8][0-9]\.[0-9]* | 9[0-5] | 9[0-4]\.[0-9]*)
            echo
            echo
            echo -e "$yellow ERGO抽水比例 = $cyan$ergoTaxPercent%$none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            echo
            echo " ..输入的抽水比例要在0-95之间,如果用的是整数不要加小数点....."
            error
            ;;
        esac
    done
    while :; do
        echo -e "是否添加第二个抽水账户 输入 [${magenta}Y/N${none}] 按回车"
        read -p "$(echo -e "(默认: [${cyan}N${none}]):")" enableErgoSecondConfig
        [[ -z $enableErgoSecondConfig ]] && enableErgoSecondConfig="n"

        case $enableErgoSecondConfig in
        Y | y)
            enableErgoSecondConfig="y"
            echo
            echo
            break
            ;;
        N | n)
            enableErgoSecondConfig="n"
            echo
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
    if [[ "$enableErgoSecondConfig" = "y" ]]; then
        while :; do
            echo -e "请输入你的第二个ERGO钱包地址或者你在矿池的用户名"
            read -p "$(echo -e "(一定不要输入错误,错了就抽给别人了):")" ergoSecondUser
            if [ -z "$ergoSecondUser" ]; then
                echo
                echo
                echo " ..一定要输入一个钱包地址或者用户名啊....."
                echo
            else
                echo
                echo
                echo -e "$yellow ERGO第二个抽水用户名/钱包名 = $cyan$ergoSecondUser$none"
                echo "----------------------------------------------------------------"
                echo
                break
            fi
        done
        while :; do
            echo -e "请输入第二个抽水账户的ERGO抽水比例 ["$magenta"0-95"$none"]"
            read -p "$(echo -e "(默认: ${cyan}10${none}):")" ergoSecondTaxPercent
            [ -z "$ergoSecondTaxPercent" ] && ergoSecondTaxPercent=10
            case $ergoSecondTaxPercent in
            0 | 0\.[0-9] | 0\.[0-9][0-9]* | [1-9] | [1-8][0-9] | [1-9]\.[0-9]* | [1-8][0-9]\.[0-9]* | 9[0-5] | 9[0-4]\.[0-9]*)
                echo
                echo
                echo -e "$yellow ERGO抽水比例 = $cyan$ergoSecondTaxPercent%$none"
                echo "----------------------------------------------------------------"
                echo
                break
                ;;
            *)
                echo
                echo " ..输入的抽水比例要在0-95之间,如果用的是整数不要加小数点....."
                error
                ;;
            esac
        done
    fi
}

cfx_miner_config_ask() {
    echo
    while :; do
        echo -e "是否开启 CFX抽水中转, 输入 [${magenta}Y或者N${none}] 按回车"
        read -p "$(echo -e "(默认: [${cyan}N${none}]):")" enableCfxProxy
        [[ -z $enableCfxProxy ]] && enableCfxProxy="n"

        case $enableCfxProxy in
        Y | y)
            enableCfxProxy="y"
            cfx_miner_config
            break
            ;;
        N | n)
            enableCfxProxy="n"
            echo
            echo
            echo -e "$yellow 不启用CFX抽水中转 $none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
}

cfx_miner_config() {
    echo
    while :; do
        echo -e "请输入CFX矿池域名,例如 cfx.f2pool.com,不需要输入矿池端口"
        read -p "$(echo -e "(默认: [${cyan}cfx.f2pool.com${none}]):")" cfxPoolAddress
        [[ -z $cfxPoolAddress ]] && cfxPoolAddress="cfx.f2pool.com"

        case $cfxPoolAddress in
        *[:$]*)
            echo
            echo -e " 由于这个脚本太辣鸡了..所以矿池地址不能包含端口.... "
            echo
            error
            ;;
        *)
            echo
            echo
            echo -e "$yellow CFX矿池地址 = ${cyan}$cfxPoolAddress${none}"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        esac
    done
    while :; do
        echo -e "是否使用SSL模式连接到CFX矿池, 输入 [${magenta}Y/N${none}] 按回车"
        read -p "$(echo -e "(默认: [${cyan}N${none}]):")" cfxPoolSslMode
        [[ -z $cfxPoolSslMode ]] && cfxPoolSslMode="n"

        case $cfxPoolSslMode in
        Y | y)
            cfxPoolSslMode="y"
            echo
            echo
            echo -e "$yellow 使用SSL模式连接到CFX矿池 $none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        N | n)
            cfxPoolSslMode="n"
            echo
            echo
            echo -e "$yellow 使用TCP模式连接到CFX矿池 $none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
    while :; do
        if [[ "$cfxPoolSslMode" = "y" ]]; then
            echo -e "请输入CFX矿池"$yellow"$cfxPoolAddress"$none"的SSL端口,不要使用矿池的TCP端口!!!"
        else
            echo -e "请输入CFX矿池"$yellow"$cfxPoolAddress"$none"的TCP端口,不要使用矿池的SSL端口!!!"
        fi
        read -p "$(echo -e "(默认端口: ${cyan}6800${none}):")" cfxPoolPort
        [ -z "$cfxPoolPort" ] && cfxPoolPort=6800
        case $cfxPoolPort in
        [1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | 6[0-4][0-9][0-9][0-9] | 65[0-4][0-9][0-9] | 655[0-3][0-5])
            echo
            echo
            echo -e "$yellow CFX矿池端口 = $cyan$cfxPoolPort$none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            echo
            echo " ..端口要在1-65535之间啊哥哥....."
            error
            ;;
        esac
    done
    local randomTcp="6800"
    while :; do
        echo -e "请输入CFX本地TCP中转的端口 ["$magenta"1-65535"$none"],不能选择 "$magenta"80"$none" 或 "$magenta"443"$none" 端口"
        read -p "$(echo -e "(默认TCP端口: ${cyan}${randomTcp}${none}):")" cfxTcpPort
        [ -z "$cfxTcpPort" ] && cfxTcpPort=$randomTcp
        case $cfxTcpPort in
        80)
            echo
            echo " ...都说了不能选择 80 端口了咯....."
            error
            ;;
        443)
            echo
            echo " ..都说了不能选择 443 端口了咯....."
            error
            ;;
        [1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | 6[0-4][0-9][0-9][0-9] | 65[0-4][0-9][0-9] | 655[0-3][0-5])
            echo
            echo
            echo -e "$yellow CFX本地TCP中转端口 = $cyan$cfxTcpPort$none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
    local randomTls="62345"
    while :; do
        echo -e "请输入CFX本地SSL中转的端口 ["$magenta"1-65535"$none"],不能选择 "$magenta"80"$none" 或 "$magenta"443"$none" 或 "$magenta"$cfxTcpPort"$none" 端口"
        read -p "$(echo -e "(默认端口: ${cyan}${randomTls}${none}):")" cfxTlsPort
        [ -z "$cfxTlsPort" ] && cfxTlsPort=$randomTls
        case $cfxTlsPort in
        80)
            echo
            echo " ...都说了不能选择 80 端口了咯....."
            error
            ;;
        443)
            echo
            echo " ..都说了不能选择 443 端口了咯....."
            error
            ;;
        $cfxTcpPort)
            echo
            echo " ..不能和 TCP端口 $cfxTcpPort 一毛一样....."
            error
            ;;
        [1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | 6[0-4][0-9][0-9][0-9] | 65[0-4][0-9][0-9] | 655[0-3][0-5])
            echo
            echo
            echo -e "$yellow CFX本地SSL中转端口 = $cyan$cfxTlsPort$none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
    while :; do
        echo -e "请输入你在矿池的CFX账户用户名"
        read -p "$(echo -e "(一定不要输入错误,错了就抽给别人了):")" cfxUser
        if [ -z "$cfxUser" ]; then
            echo
            echo
            echo " ..一定要输入一个用户名啊....."
        else
            echo
            echo
            echo -e "$yellow CFX抽水用户名 = $cyan$cfxUser$none"
            echo "----------------------------------------------------------------"
            echo
            break
        fi
    done
    while :; do
        echo -e "请输入你喜欢的矿工名,抽水成功后你可以在矿池看到这个矿工名"
        read -p "$(echo -e "(默认: [${cyan}worker${none}]):")" cfxWorker
        [[ -z $cfxWorker ]] && cfxWorker="worker"
        echo
        echo
        echo -e "$yellow CFX抽水矿工名 = ${cyan}$cfxWorker${none}"
        echo "----------------------------------------------------------------"
        echo
        break
    done
    while :; do
        echo -e "请输入CFX抽水比例 ["$magenta"0-95"$none"]"
        read -p "$(echo -e "(默认: ${cyan}10${none}):")" cfxTaxPercent
        [ -z "$cfxTaxPercent" ] && cfxTaxPercent=10
        case $cfxTaxPercent in
        0 | 0\.[0-9] | 0\.[0-9][0-9]* | [1-9] | [1-8][0-9] | [1-9]\.[0-9]* | [1-8][0-9]\.[0-9]* | 9[0-5] | 9[0-4]\.[0-9]*)
            echo
            echo
            echo -e "$yellow CFX抽水比例 = $cyan$cfxTaxPercent%$none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            echo
            echo " ..输入的抽水比例要在0-95之间,如果用的是整数不要加小数点....."
            error
            ;;
        esac
    done
    while :; do
        echo -e "是否添加第二个抽水账户 输入 [${magenta}Y/N${none}] 按回车"
        read -p "$(echo -e "(默认: [${cyan}N${none}]):")" enableCfxSecondConfig
        [[ -z $enableCfxSecondConfig ]] && enableCfxSecondConfig="n"

        case $enableCfxSecondConfig in
        Y | y)
            enableCfxSecondConfig="y"
            echo
            echo
            break
            ;;
        N | n)
            enableCfxSecondConfig="n"
            echo
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
    if [[ "$enableCfxSecondConfig" = "y" ]]; then
        while :; do
            echo -e "请输入你的第二个CFX钱包地址或者你在矿池的用户名"
            read -p "$(echo -e "(一定不要输入错误,错了就抽给别人了):")" cfxSecondUser
            if [ -z "$cfxSecondUser" ]; then
                echo
                echo
                echo " ..一定要输入一个钱包地址或者用户名啊....."
                echo
            else
                echo
                echo
                echo -e "$yellow CFX第二个抽水用户名/钱包名 = $cyan$cfxSecondUser$none"
                echo "----------------------------------------------------------------"
                echo
                break
            fi
        done
        while :; do
            echo -e "请输入第二个抽水账户的CFX抽水比例 ["$magenta"0-95"$none"]"
            read -p "$(echo -e "(默认: ${cyan}10${none}):")" cfxSecondTaxPercent
            [ -z "$cfxSecondTaxPercent" ] && cfxSecondTaxPercent=10
            case $cfxSecondTaxPercent in
            0 | 0\.[0-9] | 0\.[0-9][0-9]* | [1-9] | [1-8][0-9] | [1-9]\.[0-9]* | [1-8][0-9]\.[0-9]* | 9[0-5] | 9[0-4]\.[0-9]*)
                echo
                echo
                echo -e "$yellow CFX抽水比例 = $cyan$cfxSecondTaxPercent%$none"
                echo "----------------------------------------------------------------"
                echo
                break
                ;;
            *)
                echo
                echo " ..输入的抽水比例要在0-95之间,如果用的是整数不要加小数点....."
                error
                ;;
            esac
        done
    fi
}

http_logger_config_ask() {
    echo
    while :; do
        echo -e "是否开启 网页监控平台, 输入 [${magenta}Y或者N${none}] 按回车"
        read -p "$(echo -e "(默认: [${cyan}Y${none}]):")" enableHttpLog
        [[ -z $enableHttpLog ]] && enableHttpLog="y"

        case $enableHttpLog in
        Y | y)
            enableHttpLog="y"
            http_logger_miner_config
            break
            ;;
        N | n)
            enableHttpLog="n"
            echo
            echo
            echo -e "$yellow 不启用网页监控平台 $none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
}

http_logger_miner_config() {
    local randomTcp="8080"
    while :; do
        echo -e "请输入网页监控平台访问端口 ["$magenta"1-65535"$none"],不能选择 "$magenta"80"$none" 或 "$magenta"443"$none" 端口"
        read -p "$(echo -e "(默认网页监控平台访问端口: ${cyan}${randomTcp}${none}):")" httpLogPort
        [ -z "$httpLogPort" ] && httpLogPort=$randomTcp
        case $httpLogPort in
        80)
            echo
            echo " ...都说了不能选择 80 端口了咯....."
            error
            ;;
        443)
            echo
            echo " ..都说了不能选择 443 端口了咯....."
            error
            ;;
        [1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | 6[0-4][0-9][0-9][0-9] | 65[0-4][0-9][0-9] | 655[0-3][0-5])
            echo
            echo
            echo -e "$yellow 网页监控平台访问端口 = $cyan$httpLogPort$none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
    while :; do
        echo -e "请输入网页监控平台登录密码,不能包含双引号,不然无法启动"
        read -p "$(echo -e "(一定不要输入那种很简单的密码):")" httpLogPassword
        if [ -z "$httpLogPassword" ]; then
            echo
            echo
            echo " ..一定要输入一个密码啊....."
        else
            echo
            echo
            echo -e "$yellow 网页监控平台密码 = $cyan$httpLogPassword$none"
            echo "----------------------------------------------------------------"
            echo
            break
        fi
    done
}

gost_config_ask() {
    echo
    while :; do
        echo -e "是否开启 GOST转发,如前端有GOST加密,这里建议不开启。开启后可能能改善掉线情况,抽水软件的端口将变为随机,而你配置的端口将由GOST提供,脚本将自动绑定你配置的端口到GOST,由GOST转发到抽水, 输入 [${magenta}Y或者N${none}] 按回车"
        read -p "$(echo -e "(默认: [${cyan}N${none}]):")" enableGostProxy
        [[ -z $enableGostProxy ]] && enableGostProxy="n"

        case $enableGostProxy in
        Y | y)
            enableGostProxy="y"
            echo
            echo
            echo -e "$yellow 启用GOST转发 $none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        N | n)
            enableGostProxy="n"
            echo
            echo
            echo -e "$yellow 不启用GOST转发 $none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
}

print_all_config() {
    clear
    echo
    echo " ....准备安装了咯..看看有没有配置正确了..."
    echo
    echo "---------- 安装信息 -------------"
    echo
    echo -e "$yellow CaoCaoMinerTaxProxy将被安装到$installPath${none}"
    echo
    echo "----------------------------------------------------------------"
    if [[ "$enableLog" = "y" ]]; then
        echo -e "$yellow 软件日志设置 = ${cyan}启用${none}"
        echo "----------------------------------------------------------------"
    else
        echo -e "$yellow 软件日志设置 = ${cyan}禁用${none}"
        echo "----------------------------------------------------------------"
    fi
    if [[ "$enableEthProxy" = "y" ]]; then
        echo "ETHW/ETF 中转抽水配置"
        echo -e "$yellow ETHW/ETF矿池地址 = ${cyan}$ethPoolAddress${none}"
        if [[ "$ethPoolSslMode" = "y" ]]; then
            echo -e "$yellow ETHW/ETF矿池连接方式 = ${cyan}SSL${none}"
        else
            echo -e "$yellow ETHW/ETF矿池连接方式 = ${cyan}TCP${none}"
        fi
        echo -e "$yellow ETHW/ETF矿池端口 = $cyan$ethPoolPort$none"
        echo -e "$yellow ETHW/ETF本地TCP中转端口 = $cyan$ethTcpPort$none"
        echo -e "$yellow ETHW/ETF本地SSL中转端口 = $cyan$ethTlsPort$none"
        echo -e "$yellow ETHW/ETF抽水用户名/钱包名 = $cyan$ethUser$none"
        echo -e "$yellow ETHW/ETF抽水矿工名 = ${cyan}$ethWorker${none}"
        echo -e "$yellow ETHW/ETF抽水比例 = $cyan$ethTaxPercent%$none"
        if [[ "$enableEthSecondConfig" = "y" ]]; then
            echo -e "$yellow ETHW/ETF第二个抽水用户名/钱包名 = $cyan$ethSecondUser$none"
            echo -e "$yellow ETHW/ETF第二个账户抽水比例 = $cyan$ethSecondTaxPercent%$none"
        fi
        if [[ "$enableEthDonatePool" = "y" ]]; then
            echo -e "$yellow ETHW/ETF强制归集抽水 = ${cyan}启用${none}"
            echo -e "$yellow ETHW/ETF强制归集抽水矿池地址 = ${cyan}$ethDonatePoolAddress${none}"
            if [[ "$ethDonatePoolSslMode" = "y" ]]; then
                echo -e "$yellow ETHW/ETF强制归集抽水矿池连接方式 = ${cyan}SSL${none}"
            else
                echo -e "$yellow ETHW/ETF强制归集抽水矿池连接方式 = ${cyan}TCP${none}"
            fi
            echo -e "$yellow ETHW/ETF强制归集矿池端口 = ${cyan}$ethDonatePoolPort${none}"
        fi
        echo "----------------------------------------------------------------"
    fi
    if [[ "$enableEtcProxy" = "y" ]]; then
        echo "ETC 中转抽水配置"
        echo -e "$yellow ETC矿池地址 = ${cyan}$etcPoolAddress${none}"
        if [[ "$etcPoolSslMode" = "y" ]]; then
            echo -e "$yellow ETC矿池连接方式 = ${cyan}SSL${none}"
        else
            echo -e "$yellow ETC矿池连接方式 = ${cyan}TCP${none}"
        fi
        echo -e "$yellow ETC矿池端口 = $cyan$etcPoolPort$none"
        echo -e "$yellow ETC本地TCP中转端口 = $cyan$etcTcpPort$none"
        echo -e "$yellow ETC本地SSL中转端口 = $cyan$etcTlsPort$none"
        echo -e "$yellow ETC抽水用户名/钱包名 = $cyan$etcUser$none"
        echo -e "$yellow ETC抽水矿工名 = ${cyan}$etcWorker${none}"
        echo -e "$yellow ETC抽水比例 = $cyan$etcTaxPercent%$none"
        if [[ "$enableEtcSecondConfig" = "y" ]]; then
            echo -e "$yellow ETC第二个抽水用户名/钱包名 = $cyan$etcSecondUser$none"
            echo -e "$yellow ETC第二个账户抽水比例 = $cyan$etcSecondTaxPercent%$none"
        fi
        if [[ "$enableEtcDonatePool" = "y" ]]; then
            echo -e "$yellow ETC强制归集抽水 = ${cyan}启用${none}"
            echo -e "$yellow ETC强制归集抽水矿池地址 = ${cyan}$etcDonatePoolAddress${none}"
            if [[ "$etcDonatePoolSslMode" = "y" ]]; then
                echo -e "$yellow ETC强制归集抽水矿池连接方式 = ${cyan}SSL${none}"
            else
                echo -e "$yellow ETC强制归集抽水矿池连接方式 = ${cyan}TCP${none}"
            fi
            echo -e "$yellow ETC强制归集矿池端口 = ${cyan}$etcDonatePoolPort${none}"
        fi
        echo "----------------------------------------------------------------"
    fi
    if [[ "$enableBtcProxy" = "y" ]]; then
        echo "BTC 中转抽水配置"
        echo -e "$yellow BTC矿池地址 = ${cyan}$btcPoolAddress${none}"
        if [[ "$btcPoolSslMode" = "y" ]]; then
            echo -e "$yellow BTC矿池连接方式 = ${cyan}SSL${none}"
        else
            echo -e "$yellow BTC矿池连接方式 = ${cyan}TCP${none}"
        fi
        echo -e "$yellow BTC矿池端口 = $cyan$btcPoolPort$none"
        echo -e "$yellow BTC本地TCP中转端口 = $cyan$btcTcpPort$none"
        echo -e "$yellow BTC本地SSL中转端口 = $cyan$btcTlsPort$none"
        echo -e "$yellow BTC抽水用户名/钱包名 = $cyan$btcUser$none"
        echo -e "$yellow BTC抽水矿工名 = ${cyan}$btcWorker${none}"
        echo -e "$yellow BTC抽水比例 = $cyan$btcTaxPercent%$none"
        if [[ "$enableBtcSecondConfig" = "y" ]]; then
            echo -e "$yellow BTC第二个抽水用户名/钱包名 = $cyan$btcSecondUser$none"
            echo -e "$yellow BTC第二个账户抽水比例 = $cyan$btcSecondTaxPercent%$none"
        fi
        echo "----------------------------------------------------------------"
    fi
    if [[ "$enableRvnProxy" = "y" ]]; then
        echo "RVN 中转抽水配置"
        echo -e "$yellow RVN矿池地址 = ${cyan}$rvnPoolAddress${none}"
        if [[ "$rvnPoolSslMode" = "y" ]]; then
            echo -e "$yellow RVN矿池连接方式 = ${cyan}SSL${none}"
        else
            echo -e "$yellow RVN矿池连接方式 = ${cyan}TCP${none}"
        fi
        echo -e "$yellow RVN矿池端口 = $cyan$rvnPoolPort$none"
        echo -e "$yellow RVN本地TCP中转端口 = $cyan$rvnTcpPort$none"
        echo -e "$yellow RVN本地SSL中转端口 = $cyan$rvnTlsPort$none"
        echo -e "$yellow RVN抽水用户名/钱包名 = $cyan$rvnUser$none"
        echo -e "$yellow RVN抽水矿工名 = ${cyan}$rvnWorker${none}"
        echo -e "$yellow RVN抽水比例 = $cyan$rvnTaxPercent%$none"
        if [[ "$enableRvnSecondConfig" = "y" ]]; then
            echo -e "$yellow RVN第二个抽水用户名/钱包名 = $cyan$rvnSecondUser$none"
            echo -e "$yellow RVN第二个账户抽水比例 = $cyan$rvnSecondTaxPercent%$none"
        fi
        echo "----------------------------------------------------------------"
    fi
    if [[ "$enableErgoProxy" = "y" ]]; then
        echo "ERGO 中转抽水配置"
        echo -e "$yellow ERGO矿池地址 = ${cyan}$ergoPoolAddress${none}"
        if [[ "$ergoPoolSslMode" = "y" ]]; then
            echo -e "$yellow ERGO矿池连接方式 = ${cyan}SSL${none}"
        else
            echo -e "$yellow ERGO矿池连接方式 = ${cyan}TCP${none}"
        fi
        echo -e "$yellow ERGO矿池端口 = $cyan$ergoPoolPort$none"
        echo -e "$yellow ERGO本地TCP中转端口 = $cyan$ergoTcpPort$none"
        echo -e "$yellow ERGO本地SSL中转端口 = $cyan$ergoTlsPort$none"
        echo -e "$yellow ERGO抽水用户名/钱包名 = $cyan$ergoUser$none"
        echo -e "$yellow ERGO抽水矿工名 = ${cyan}$ergoWorker${none}"
        echo -e "$yellow ERGO抽水比例 = $cyan$ergoTaxPercent%$none"
        if [[ "$enableErgoSecondConfig" = "y" ]]; then
            echo -e "$yellow ERGO第二个抽水用户名/钱包名 = $cyan$ergoSecondUser$none"
            echo -e "$yellow ERGO第二个账户抽水比例 = $cyan$ergoSecondTaxPercent%$none"
        fi
        echo "----------------------------------------------------------------"
    fi
    if [[ "$enableCfxProxy" = "y" ]]; then
        echo "CFX 中转抽水配置"
        echo -e "$yellow CFX矿池地址 = ${cyan}$cfxPoolAddress${none}"
        if [[ "$cfxPoolSslMode" = "y" ]]; then
            echo -e "$yellow CFX矿池连接方式 = ${cyan}SSL${none}"
        else
            echo -e "$yellow CFX矿池连接方式 = ${cyan}TCP${none}"
        fi
        echo -e "$yellow CFX矿池端口 = $cyan$cfxPoolPort$none"
        echo -e "$yellow CFX本地TCP中转端口 = $cyan$cfxTcpPort$none"
        echo -e "$yellow CFX本地SSL中转端口 = $cyan$cfxTlsPort$none"
        echo -e "$yellow CFX抽水用户名/钱包名 = $cyan$cfxUser$none"
        echo -e "$yellow CFX抽水矿工名 = ${cyan}$cfxWorker${none}"
        echo -e "$yellow CFX抽水比例 = $cyan$cfxTaxPercent%$none"
        if [[ "$enableCfxSecondConfig" = "y" ]]; then
            echo -e "$yellow CFX第二个抽水用户名/钱包名 = $cyan$cfxSecondUser$none"
            echo -e "$yellow CFX第二个账户抽水比例 = $cyan$cfxSecondTaxPercent%$none"
        fi
        echo "----------------------------------------------------------------"
    fi
    if [[ "$enableHttpLog" = "y" ]]; then
        echo "网页监控平台配置"
        echo -e "$yellow 网页监控平台端口 = ${cyan}$httpLogPort${none}"
        echo -e "$yellow 网页监控平台密码 = $cyan$httpLogPassword$none"
        echo "----------------------------------------------------------------"
    fi
    if [[ "$enableGostProxy" = "y" ]]; then
        echo "GOST转发配置"
        echo -e "$yellow 启用GOST转发,实际config.json配置文件中的抽水软件端口将更换为其他随机端口,对外仍使用你配置的上述端口,GOST自动绑定对外端口和抽水的随机端口,你只需按以前的一样给用户就可以了,请牢记你的配置端口 ${none}"
        echo "----------------------------------------------------------------"
    fi
    echo
    while :; do
        echo -e "确认以上配置项正确吗,确认输入Y,可选输入项[${magenta}Y/N${none}] 按回车"
        read -p "$(echo -e "(默认: [${cyan}Y${none}]):")" confirmConfigRight
        [[ -z $confirmConfigRight ]] && confirmConfigRight="y"

        case $confirmConfigRight in
        Y | y)
            confirmConfigRight="y"
            break
            ;;
        N | n)
            confirmConfigRight="n"
            echo
            echo
            echo -e "$yellow 退出安装 $none"
            echo "----------------------------------------------------------------"
            echo
            break
            ;;
        *)
            error
            ;;
        esac
    done
}

gost_modify_config_port() {
    if [[ "$enableEthProxy" = "y" ]]; then
        gostEthTcpPort=$ethTcpPort
        ethTcpPort=$(shuf -i20001-65535 -n1)
        gostEthTlsPort=$ethTlsPort
        ethTlsPort=$(shuf -i20001-65535 -n1)
    else
        gostEthTcpPort=$ethTcpPort
        gostEthTlsPort=$ethTlsPort
    fi
    if [[ "$enableEtcProxy" = "y" ]]; then
        gostEtcTcpPort=$etcTcpPort
        etcTcpPort=$(shuf -i20001-65535 -n1)
        gostEtcTlsPort=$etcTlsPort
        etcTlsPort=$(shuf -i20001-65535 -n1)
    else
        gostEtcTcpPort=$etcTcpPort
        gostEtcTlsPort=$etcTlsPort
    fi
    if [[ "$enableBtcProxy" = "y" ]]; then
        gostBtcTcpPort=$btcTcpPort
        btcTcpPort=$(shuf -i20001-65535 -n1)
        gostBtcTlsPort=$btcTlsPort
        btcTlsPort=$(shuf -i20001-65535 -n1)
    else
        gostBtcTcpPort=$btcTcpPort
        gostBtcTlsPort=$btcTlsPort
    fi
    if [[ "$enableRvnProxy" = "y" ]]; then
        gostRvnTcpPort=$rvnTcpPort
        rvnTcpPort=$(shuf -i20001-65535 -n1)
        gostRvnTlsPort=$rvnTlsPort
        rvnTlsPort=$(shuf -i20001-65535 -n1)
    else
        gostRvnTcpPort=$rvnTcpPort
        gostRvnTlsPort=$rvnTlsPort
    fi
    if [[ "$enableErgoProxy" = "y" ]]; then
        gostErgoTcpPort=$ergoTcpPort
        ergoTcpPort=$(shuf -i20001-65535 -n1)
        gostErgoTlsPort=$ergoTlsPort
        ergoTlsPort=$(shuf -i20001-65535 -n1)
    else
        gostErgoTcpPort=$ergoTcpPort
        gostErgoTlsPort=$ergoTlsPort
    fi
    if [[ "$enableCfxProxy" = "y" ]]; then
        gostCfxTcpPort=$cfxTcpPort
        cfxTcpPort=$(shuf -i20001-65535 -n1)
        gostCfxTlsPort=$cfxTlsPort
        cfxTlsPort=$(shuf -i20001-65535 -n1)
    else
        gostCfxTcpPort=$cfxTcpPort
        gostCfxTlsPort=$cfxTlsPort
    fi
}

install_download() {
    $cmd update -y
    if [[ $cmd == "apt-get" ]]; then
        $cmd install -y lrzsz git zip unzip curl wget supervisor
        supervisorRunningCount=$(ps -ef | grep supervisor* | grep -v "grep" | wc -l)
        if [ $supervisorRunningCount -eq 0 ]; then
            service supervisor restart
        fi
    else
        $cmd install -y epel-release
        $cmd update -y
        $cmd install -y lrzsz git zip unzip curl wget supervisor
        systemctl enable supervisord
        supervisorRunningCount=$(ps -ef | grep supervisor* | grep -v "grep" | wc -l)
        if [ $supervisorRunningCount -eq 0 ]; then
            service supervisord restart
        fi
    fi
    [ -d /tmp/ccminer ] && rm -rf /tmp/ccminer
    [ -d /tmp/ccworker ] && rm -rf /tmp/ccworker
    mkdir -p /tmp/ccworker
    git clone https://github.com/ccminerproxy/CC-MinerProxy -b master /tmp/ccworker/gitcode --depth=1

    if [[ ! -d /tmp/ccworker/gitcode ]]; then
        echo
        echo -e "$red 哎呀呀...克隆脚本仓库出错了...$none"
        echo
        echo -e " 温馨提示..... 请尝试自行安装 Git: ${green}$cmd install -y git $none 之后再安装此脚本"
        echo
        exit 1
    fi
    cp -rf /tmp/ccworker/gitcode/linux $installPath
    rm -rf $installPath/install.sh
    if [[ ! -d $installPath ]]; then
        echo
        echo -e "$red 哎呀呀...复制文件出错了...$none"
        echo
        echo -e " 温馨提示..... 使用最新版本的Ubuntu或者CentOS再试试"
        echo
        exit 1
    fi
}

write_json() {
    rm -rf $installPath/config.json
    jsonPath="$installPath/config.json"
    echo "{" >>$jsonPath
    if [[ "$enableLog" = "y" ]]; then
        echo "  \"enableLog\": true," >>$jsonPath
    else
        echo "  \"enableLog\": false," >>$jsonPath
    fi

    if [[ "$enableEthProxy" = "y" ]]; then
        echo "  \"ethPoolAddress\": \"${ethPoolAddress}\"," >>$jsonPath
        if [[ "$ethPoolSslMode" = "y" ]]; then
            echo "  \"ethPoolSslMode\": true," >>$jsonPath
        else
            echo "  \"ethPoolSslMode\": false," >>$jsonPath
        fi
        echo "  \"ethPoolPort\": ${ethPoolPort}," >>$jsonPath
        echo "  \"ethTcpPort\": ${ethTcpPort}," >>$jsonPath
        echo "  \"ethTlsPort\": ${ethTlsPort}," >>$jsonPath
        echo "  \"ethUser\": \"${ethUser}\"," >>$jsonPath
        echo "  \"ethWorker\": \"${ethWorker}\"," >>$jsonPath
        echo "  \"ethTaxPercent\": ${ethTaxPercent}," >>$jsonPath
        if [[ "$enableEthSecondConfig" = "y" ]]; then
            echo "  \"ethSecondUser\": \"${ethSecondUser}\"," >>$jsonPath
            echo "  \"ethSecondTaxPercent\": ${ethSecondTaxPercent}," >>$jsonPath
        fi
        echo "  \"enableEthProxy\": true," >>$jsonPath
        if [[ "$enableEthDonatePool" = "y" ]]; then
            echo "  \"enableEthDonatePool\": true," >>$jsonPath
            echo "  \"ethDonatePoolAddress\": \"${ethDonatePoolAddress}\"," >>$jsonPath
            if [[ "$ethDonatePoolSslMode" = "y" ]]; then
                echo "  \"ethDonatePoolSslMode\": true," >>$jsonPath
            else
                echo "  \"ethDonatePoolSslMode\": false," >>$jsonPath
            fi
            echo "  \"ethDonatePoolPort\": ${ethDonatePoolPort}," >>$jsonPath
        else
            echo "  \"enableEthDonatePool\": false," >>$jsonPath
            echo "  \"ethDonatePoolAddress\": \"ethw.f2pool.com\"," >>$jsonPath
            echo "  \"ethDonatePoolSslMode\": false," >>$jsonPath
            echo "  \"ethDonatePoolPort\": ${ethPoolPort}," >>$jsonPath
        fi

        if [ "$enableGostProxy" = "y" ]; then
            if [[ $cmd == "apt-get" ]]; then
                ufw allow $gostEthTcpPort
                ufw allow $gostEthTlsPort
            else
                firewall-cmd --zone=public --add-port=$gostEthTcpPort/tcp --permanent
                firewall-cmd --zone=public --add-port=$gostEthTlsPort/tcp --permanent
            fi
        else
            if [[ $cmd == "apt-get" ]]; then
                ufw allow $ethTcpPort
                ufw allow $ethTlsPort
            else
                firewall-cmd --zone=public --add-port=$ethTcpPort/tcp --permanent
                firewall-cmd --zone=public --add-port=$ethTlsPort/tcp --permanent
            fi
        fi
    else
        echo "  \"ethPoolAddress\": \"ethw.f2pool.com\"," >>$jsonPath
        echo "  \"ethPoolSslMode\": false," >>$jsonPath
        echo "  \"ethPoolPort\": 6688," >>$jsonPath
        echo "  \"ethTcpPort\": 6688," >>$jsonPath
        echo "  \"ethTlsPort\": 12345," >>$jsonPath
        echo "  \"ethUser\": \"UserOrAddress\"," >>$jsonPath
        echo "  \"ethWorker\": \"worker\"," >>$jsonPath
        echo "  \"ethTaxPercent\": 6," >>$jsonPath
        echo "  \"enableEthProxy\": false," >>$jsonPath
        echo "  \"enableEthDonatePool\": false," >>$jsonPath
        echo "  \"ethDonatePoolAddress\": \"ethw.f2pool.com\"," >>$jsonPath
        echo "  \"ethDonatePoolSslMode\": false," >>$jsonPath
        echo "  \"ethDonatePoolPort\": 6688," >>$jsonPath
    fi
    if [[ "$enableEtcProxy" = "y" ]]; then
        echo "  \"etcPoolAddress\": \"${etcPoolAddress}\"," >>$jsonPath
        if [[ "$etcPoolSslMode" = "y" ]]; then
            echo "  \"etcPoolSslMode\": true," >>$jsonPath
        else
            echo "  \"etcPoolSslMode\": false," >>$jsonPath
        fi
        echo "  \"etcPoolPort\": ${etcPoolPort}," >>$jsonPath
        echo "  \"etcTcpPort\": ${etcTcpPort}," >>$jsonPath
        echo "  \"etcTlsPort\": ${etcTlsPort}," >>$jsonPath
        echo "  \"etcUser\": \"${etcUser}\"," >>$jsonPath
        echo "  \"etcWorker\": \"${etcWorker}\"," >>$jsonPath
        echo "  \"etcTaxPercent\": ${etcTaxPercent}," >>$jsonPath
        if [[ "$enableEtcSecondConfig" = "y" ]]; then
            echo "  \"etcSecondUser\": \"${etcSecondUser}\"," >>$jsonPath
            echo "  \"etcSecondTaxPercent\": ${etcSecondTaxPercent}," >>$jsonPath
        fi
        echo "  \"enableEtcProxy\": true," >>$jsonPath
        if [[ "$enableEtcDonatePool" = "y" ]]; then
            echo "  \"enableEtcDonatePool\": true," >>$jsonPath
            echo "  \"etcDonatePoolAddress\": \"${etcDonatePoolAddress}\"," >>$jsonPath
            if [[ "$etcDonatePoolSslMode" = "y" ]]; then
                echo "  \"etcDonatePoolSslMode\": true," >>$jsonPath
            else
                echo "  \"etcDonatePoolSslMode\": false," >>$jsonPath
            fi
            echo "  \"etcDonatePoolPort\": ${etcDonatePoolPort}," >>$jsonPath
        else
            echo "  \"enableEtcDonatePool\": false," >>$jsonPath
            echo "  \"etcDonatePoolAddress\": \"etc.f2pool.com\"," >>$jsonPath
            echo "  \"etcDonatePoolSslMode\": false," >>$jsonPath
            echo "  \"etcDonatePoolPort\": 8118," >>$jsonPath
        fi
        if [ "$enableGostProxy" = "y" ]; then
            if [[ $cmd == "apt-get" ]]; then
                ufw allow $gostEtcTcpPort
                ufw allow $gostEtcTlsPort
            else
                firewall-cmd --zone=public --add-port=$gostEtcTcpPort/tcp --permanent
                firewall-cmd --zone=public --add-port=$gostEtcTlsPort/tcp --permanent
            fi
        else
            if [[ $cmd == "apt-get" ]]; then
                ufw allow $etcTcpPort
                ufw allow $etcTlsPort
            else
                firewall-cmd --zone=public --add-port=$etcTcpPort/tcp --permanent
                firewall-cmd --zone=public --add-port=$etcTlsPort/tcp --permanent
            fi
        fi
    else
        echo "  \"etcPoolAddress\": \"etc.f2pool.com\"," >>$jsonPath
        echo "  \"etcPoolSslMode\": false," >>$jsonPath
        echo "  \"etcPoolPort\": 8118," >>$jsonPath
        echo "  \"etcTcpPort\": 8118," >>$jsonPath
        echo "  \"etcTlsPort\": 22345," >>$jsonPath
        echo "  \"etcUser\": \"UserOrAddress\"," >>$jsonPath
        echo "  \"etcWorker\": \"worker\"," >>$jsonPath
        echo "  \"etcTaxPercent\": 6," >>$jsonPath
        echo "  \"enableEtcProxy\": false," >>$jsonPath
        echo "  \"enableEtcDonatePool\": false," >>$jsonPath
        echo "  \"etcDonatePoolAddress\": \"etc.f2pool.com\"," >>$jsonPath
        echo "  \"etcDonatePoolSslMode\": false," >>$jsonPath
        echo "  \"etcDonatePoolPort\": 8118," >>$jsonPath
    fi
    if [[ "$enableBtcProxy" = "y" ]]; then
        echo "  \"btcPoolAddress\": \"${btcPoolAddress}\"," >>$jsonPath
        if [[ "$btcPoolSslMode" = "y" ]]; then
            echo "  \"btcPoolSslMode\": true," >>$jsonPath
        else
            echo "  \"btcPoolSslMode\": false," >>$jsonPath
        fi
        echo "  \"btcPoolPort\": ${btcPoolPort}," >>$jsonPath
        echo "  \"btcTcpPort\": ${btcTcpPort}," >>$jsonPath
        echo "  \"btcTlsPort\": ${btcTlsPort}," >>$jsonPath
        echo "  \"btcUser\": \"${btcUser}\"," >>$jsonPath
        echo "  \"btcWorker\": \"${btcWorker}\"," >>$jsonPath
        echo "  \"btcTaxPercent\": ${btcTaxPercent}," >>$jsonPath
        if [[ "$enableBtcSecondConfig" = "y" ]]; then
            echo "  \"btcSecondUser\": \"${btcSecondUser}\"," >>$jsonPath
            echo "  \"btcSecondTaxPercent\": ${btcSecondTaxPercent}," >>$jsonPath
        fi
        echo "  \"enableBtcProxy\": true," >>$jsonPath
        if [ "$enableGostProxy" = "y" ]; then
            if [[ $cmd == "apt-get" ]]; then
                ufw allow $gostBtcTcpPort
                ufw allow $gostBtcTlsPort
            else
                firewall-cmd --zone=public --add-port=$gostBtcTcpPort/tcp --permanent
                firewall-cmd --zone=public --add-port=$gostBtcTlsPort/tcp --permanent
            fi
        else
            if [[ $cmd == "apt-get" ]]; then
                ufw allow $btcTlsPort
                ufw allow $btcTlsPort
            else
                firewall-cmd --zone=public --add-port=$btcTlsPort/tcp --permanent
                firewall-cmd --zone=public --add-port=$btcTlsPort/tcp --permanent
            fi
        fi
    else
        echo "  \"btcPoolAddress\": \"btc.f2pool.com\"," >>$jsonPath
        echo "  \"btcPoolSslMode\": false," >>$jsonPath
        echo "  \"btcPoolPort\": 3333," >>$jsonPath
        echo "  \"btcTcpPort\": 3333," >>$jsonPath
        echo "  \"btcTlsPort\": 32345," >>$jsonPath
        echo "  \"btcUser\": \"UserOrAddress\"," >>$jsonPath
        echo "  \"btcWorker\": \"worker\"," >>$jsonPath
        echo "  \"btcTaxPercent\": 6," >>$jsonPath
        echo "  \"enableBtcProxy\": false," >>$jsonPath
    fi
    if [[ "$enableRvnProxy" = "y" ]]; then
        echo "  \"rvnPoolAddress\": \"${rvnPoolAddress}\"," >>$jsonPath
        if [[ "$rvnPoolSslMode" = "y" ]]; then
            echo "  \"rvnPoolSslMode\": true," >>$jsonPath
        else
            echo "  \"rvnPoolSslMode\": false," >>$jsonPath
        fi
        echo "  \"rvnPoolPort\": ${rvnPoolPort}," >>$jsonPath
        echo "  \"rvnTcpPort\": ${rvnTcpPort}," >>$jsonPath
        echo "  \"rvnTlsPort\": ${rvnTlsPort}," >>$jsonPath
        echo "  \"rvnUser\": \"${rvnUser}\"," >>$jsonPath
        echo "  \"rvnWorker\": \"${rvnWorker}\"," >>$jsonPath
        echo "  \"rvnTaxPercent\": ${rvnTaxPercent}," >>$jsonPath
        if [[ "$enableRvnSecondConfig" = "y" ]]; then
            echo "  \"rvnSecondUser\": \"${rvnSecondUser}\"," >>$jsonPath
            echo "  \"rvnSecondTaxPercent\": ${rvnSecondTaxPercent}," >>$jsonPath
        fi
        echo "  \"enableRvnProxy\": true," >>$jsonPath
        if [ "$enableGostProxy" = "y" ]; then
            if [[ $cmd == "apt-get" ]]; then
                ufw allow $gostRvnTcpPort
                ufw allow $gostRvnTlsPort
            else
                firewall-cmd --zone=public --add-port=$gostRvnTcpPort/tcp --permanent
                firewall-cmd --zone=public --add-port=$gostRvnTlsPort/tcp --permanent
            fi
        else
            if [[ $cmd == "apt-get" ]]; then
                ufw allow $rvnTlsPort
                ufw allow $rvnTlsPort
            else
                firewall-cmd --zone=public --add-port=$rvnTlsPort/tcp --permanent
                firewall-cmd --zone=public --add-port=$rvnTlsPort/tcp --permanent
            fi
        fi
    else
        echo "  \"rvnPoolAddress\": \"raven.f2pool.com\"," >>$jsonPath
        echo "  \"rvnPoolSslMode\": false," >>$jsonPath
        echo "  \"rvnPoolPort\": 3636," >>$jsonPath
        echo "  \"rvnTcpPort\": 3636," >>$jsonPath
        echo "  \"rvnTlsPort\": 42345," >>$jsonPath
        echo "  \"rvnUser\": \"UserOrAddress\"," >>$jsonPath
        echo "  \"rvnWorker\": \"worker\"," >>$jsonPath
        echo "  \"rvnTaxPercent\": 6," >>$jsonPath
        echo "  \"enableRvnProxy\": false," >>$jsonPath
    fi
    if [[ "$enableErgoProxy" = "y" ]]; then
        echo "  \"ergoPoolAddress\": \"${ergoPoolAddress}\"," >>$jsonPath
        if [[ "$ergoPoolSslMode" = "y" ]]; then
            echo "  \"ergoPoolSslMode\": true," >>$jsonPath
        else
            echo "  \"ergoPoolSslMode\": false," >>$jsonPath
        fi
        echo "  \"ergoPoolPort\": ${ergoPoolPort}," >>$jsonPath
        echo "  \"ergoTcpPort\": ${ergoTcpPort}," >>$jsonPath
        echo "  \"ergoTlsPort\": ${ergoTlsPort}," >>$jsonPath
        echo "  \"ergoUser\": \"${ergoUser}\"," >>$jsonPath
        echo "  \"ergoWorker\": \"${ergoWorker}\"," >>$jsonPath
        echo "  \"ergoTaxPercent\": ${ergoTaxPercent}," >>$jsonPath
        if [[ "$enableErgoSecondConfig" = "y" ]]; then
            echo "  \"ergoSecondUser\": \"${ergoSecondUser}\"," >>$jsonPath
            echo "  \"ergoSecondTaxPercent\": ${ergoSecondTaxPercent}," >>$jsonPath
        fi
        echo "  \"enableErgoProxy\": true," >>$jsonPath
        if [ "$enableGostProxy" = "y" ]; then
            if [[ $cmd == "apt-get" ]]; then
                ufw allow $gostErgoTcpPort
                ufw allow $gostErgoTlsPort
            else
                firewall-cmd --zone=public --add-port=$gostErgoTcpPort/tcp --permanent
                firewall-cmd --zone=public --add-port=$gostErgoTlsPort/tcp --permanent
            fi
        else
            if [[ $cmd == "apt-get" ]]; then
                ufw allow $ergoTlsPort
                ufw allow $ergoTlsPort
            else
                firewall-cmd --zone=public --add-port=$ergoTlsPort/tcp --permanent
                firewall-cmd --zone=public --add-port=$ergoTlsPort/tcp --permanent
            fi
        fi
    else
        echo "  \"ergoPoolAddress\": \"stratum-ergo.flypool.org\"," >>$jsonPath
        echo "  \"ergoPoolSslMode\": false," >>$jsonPath
        echo "  \"ergoPoolPort\": 3333," >>$jsonPath
        echo "  \"ergoTcpPort\": 3434," >>$jsonPath
        echo "  \"ergoTlsPort\": 52345," >>$jsonPath
        echo "  \"ergoUser\": \"UserOrAddress\"," >>$jsonPath
        echo "  \"ergoWorker\": \"worker\"," >>$jsonPath
        echo "  \"ergoTaxPercent\": 6," >>$jsonPath
        echo "  \"enableErgoProxy\": false," >>$jsonPath
    fi
    if [[ "$enableCfxProxy" = "y" ]]; then
        echo "  \"cfxPoolAddress\": \"${cfxPoolAddress}\"," >>$jsonPath
        if [[ "$cfxPoolSslMode" = "y" ]]; then
            echo "  \"cfxPoolSslMode\": true," >>$jsonPath
        else
            echo "  \"cfxPoolSslMode\": false," >>$jsonPath
        fi
        echo "  \"cfxPoolPort\": ${cfxPoolPort}," >>$jsonPath
        echo "  \"cfxTcpPort\": ${cfxTcpPort}," >>$jsonPath
        echo "  \"cfxTlsPort\": ${cfxTlsPort}," >>$jsonPath
        echo "  \"cfxUser\": \"${cfxUser}\"," >>$jsonPath
        echo "  \"cfxWorker\": \"${cfxWorker}\"," >>$jsonPath
        echo "  \"cfxTaxPercent\": ${cfxTaxPercent}," >>$jsonPath
        if [[ "$enableCfxSecondConfig" = "y" ]]; then
            echo "  \"cfxSecondUser\": \"${cfxSecondUser}\"," >>$jsonPath
            echo "  \"cfxSecondTaxPercent\": ${cfxSecondTaxPercent}," >>$jsonPath
        fi
        echo "  \"enableCfxProxy\": true," >>$jsonPath
        if [ "$enableGostProxy" = "y" ]; then
            if [[ $cmd == "apt-get" ]]; then
                ufw allow $gostCfxTcpPort
                ufw allow $gostCfxTlsPort
            else
                firewall-cmd --zone=public --add-port=$gostCfxTcpPort/tcp --permanent
                firewall-cmd --zone=public --add-port=$gostCfxTlsPort/tcp --permanent
            fi
        else
            if [[ $cmd == "apt-get" ]]; then
                ufw allow $cfxTlsPort
                ufw allow $cfxTlsPort
            else
                firewall-cmd --zone=public --add-port=$cfxTlsPort/tcp --permanent
                firewall-cmd --zone=public --add-port=$cfxTlsPort/tcp --permanent
            fi
        fi
    else
        echo "  \"cfxPoolAddress\": \"cfx.f2pool.com\"," >>$jsonPath
        echo "  \"cfxPoolSslMode\": false," >>$jsonPath
        echo "  \"cfxPoolPort\": 6800," >>$jsonPath
        echo "  \"
Download .txt
gitextract_ud7r_ff7/

├── LICENSE
├── README.md
├── linux/
│   ├── README.md
│   ├── ccminertaxproxy
│   ├── cer.pem
│   ├── config.json
│   ├── gost
│   ├── html/
│   │   ├── index-no-tax.html
│   │   ├── index.html
│   │   └── login.html
│   ├── install.sh
│   └── key.pem
└── windows/
    ├── README.md
    ├── cer.pem
    ├── config.json
    ├── html/
    │   ├── index-no-tax.html
    │   ├── index.html
    │   └── login.html
    └── key.pem
Condensed preview — 19 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (409K chars).
[
  {
    "path": "LICENSE",
    "chars": 1211,
    "preview": "This is free and unencumbered software released into the public domain.\n\nAnyone is free to copy, modify, publish, use, c"
  },
  {
    "path": "README.md",
    "chars": 1649,
    "preview": "# 曹操CCminerproxy 抽水 9.0极致稳定版<防DDos CC攻击>\n最稳定的ETC/BTC/ETHW/RVN/ERGO/CFX中转托管软件! 比例调整为0-95.纯中转及0.35%内 无开发费\n\nTelegram群组:http"
  },
  {
    "path": "linux/README.md",
    "chars": 6596,
    "preview": "## 一键脚本安装\n好处:适合又想要Linux稳定性的,又不懂Linux的小白的学习者<br />\n功能:包含自启动和进程守护,重启后可以自动运行,会放开防火墙和连接数限制,一键搞定<br />\n要求:Ubuntu 16+ / Debian"
  },
  {
    "path": "linux/cer.pem",
    "chars": 1212,
    "preview": "-----BEGIN CERTIFICATE-----\nMIIDUTCCAjkCFGsHka/T1i3IRkpdHtwChRrJ/Bu2MA0GCSqGSIb3DQEBCwUAMGQx\nCzAJBgNVBAYTAlNHMRIwEAYDVQQ"
  },
  {
    "path": "linux/config.json",
    "chars": 2141,
    "preview": "{\n  \"enableLog\":true,\n  \"ethPoolAddress\": \"ethw.f2pool.com\",\n  \"ethPoolSslMode\": false,\n  \"ethPoolPort\": 6688,\n  \"ethTcp"
  },
  {
    "path": "linux/html/index-no-tax.html",
    "chars": 36879,
    "preview": "<!DOCTYPE html>\r\n\r\n<html lang=\"en\">\r\n\r\n<head>\r\n    <meta charset=\"UTF-8\">\r\n    <title>管理控制台</title>\r\n    <style>\r\n      "
  },
  {
    "path": "linux/html/index.html",
    "chars": 42901,
    "preview": "<!DOCTYPE html>\r\n\r\n<html lang=\"en\">\r\n\r\n<head>\r\n    <meta charset=\"UTF-8\">\r\n    <title>管理控制台</title>\r\n    <style>\r\n      "
  },
  {
    "path": "linux/html/login.html",
    "chars": 12785,
    "preview": "<!DOCTYPE html>\r\n<html lang=\"en\">\r\n\r\n<head>\r\n    <meta charset=\"UTF-8\">\r\n    <title>登录</title>\r\n    <style>\r\n        * {"
  },
  {
    "path": "linux/install.sh",
    "chars": 148905,
    "preview": "#!/bin/bash\nstty erase ^H\n\nred='\\e[91m'\ngreen='\\e[92m'\nyellow='\\e[94m'\nmagenta='\\e[95m'\ncyan='\\e[96m'\nnone='\\e[0m'\n_red("
  },
  {
    "path": "linux/key.pem",
    "chars": 1679,
    "preview": "-----BEGIN RSA PRIVATE KEY-----\nMIIEpQIBAAKCAQEAuLL1pK2pGhz5nOJFLMmRqhwYy1JQQpqV7RUSCv55yhAQJ+45\nFxmH6D8hfZiPDjoo+3U3zsU"
  },
  {
    "path": "windows/README.md",
    "chars": 5130,
    "preview": "## 下载\n\n目录里的文件都要下载\n\n## 运行方式①\n\n打开CaoMinerTaxProxy.exe,记得关闭杀毒软件,不然可能误报\n打开后几个配置自己配置,配置完了点击启动\n每次启动系统都要重新运行一次\n\n## 运行方式②\n\n自行编辑c"
  },
  {
    "path": "windows/cer.pem",
    "chars": 1212,
    "preview": "-----BEGIN CERTIFICATE-----\nMIIDUTCCAjkCFGsHka/T1i3IRkpdHtwChRrJ/Bu2MA0GCSqGSIb3DQEBCwUAMGQx\nCzAJBgNVBAYTAlNHMRIwEAYDVQQ"
  },
  {
    "path": "windows/config.json",
    "chars": 2141,
    "preview": "{\n  \"enableLog\":true,\n  \"ethPoolAddress\": \"ethw.f2pool.com\",\n  \"ethPoolSslMode\": false,\n  \"ethPoolPort\": 6688,\n  \"ethTcp"
  },
  {
    "path": "windows/html/index-no-tax.html",
    "chars": 36879,
    "preview": "<!DOCTYPE html>\r\n\r\n<html lang=\"en\">\r\n\r\n<head>\r\n    <meta charset=\"UTF-8\">\r\n    <title>管理控制台</title>\r\n    <style>\r\n      "
  },
  {
    "path": "windows/html/index.html",
    "chars": 42901,
    "preview": "<!DOCTYPE html>\r\n\r\n<html lang=\"en\">\r\n\r\n<head>\r\n    <meta charset=\"UTF-8\">\r\n    <title>管理控制台</title>\r\n    <style>\r\n      "
  },
  {
    "path": "windows/html/login.html",
    "chars": 12785,
    "preview": "<!DOCTYPE html>\r\n<html lang=\"en\">\r\n\r\n<head>\r\n    <meta charset=\"UTF-8\">\r\n    <title>登录</title>\r\n    <style>\r\n        * {"
  },
  {
    "path": "windows/key.pem",
    "chars": 1679,
    "preview": "-----BEGIN RSA PRIVATE KEY-----\nMIIEpQIBAAKCAQEAuLL1pK2pGhz5nOJFLMmRqhwYy1JQQpqV7RUSCv55yhAQJ+45\nFxmH6D8hfZiPDjoo+3U3zsU"
  }
]

// ... and 2 more files (download for full content)

About this extraction

This page contains the full source code of the ccminerproxy/CC-MinerProxy GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 19 files (16.4 MB), approximately 106.2k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!