forked from elysias123/whitelist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
60 lines (46 loc) · 1.02 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#! /bin/bash
#环境配置
update(){
sudo apt update
sudo apt install python3-pip -y
sudo apt install git
sudo pip3 install requests
sudo pip3 install netaddr
clear
}
#获取主程序
down(){
git clone https://github.com/heinu123/whitelist.git /usr/whitelist
clear
}
#Main
echo "Hello World"
sleep 1
update
down
cd /usr/whitelist
echo "请输入节点端口(多个端口请用 , 分隔)"
read port
echo "请输入web认证端口"
read web_port
echo "请输入认证路径(例如/aries)"
read path
echo "请输入认证用户名"
read username
echo "请输入认证密码"
read password
echo "获取信息完成,已经写入脚本"
cat <<text >./config.py
port = [ ${port} ]
web_port = ${web_port}
URL_PATH = "${path}"
USERNAME = '${username}'
PASSWORD = '${password}'
text
echo "配置环境完成,挂起后台执行"
nohup python3 -u web.py > iplog.out 2>&1 &
clear
echo "认证信息:"
echo "`curl -s ifconfig.me/ip`:${web_port}${path}"
echo "用户名:${username}"
echo "密码:${password}"