-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
184 lines (163 loc) · 6.17 KB
/
main.py
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
import subprocess
from ufwset import ufwrun
from ssl import takessl
from backup_xui import backup_do
from firewall_iran import firewall
from nameserver import dns
def other_tunnel():
chmod_process = subprocess.run(["chmod", '+x', '/root/Config-server/6TO4-GRE-IPIP-SIT/ipipv2.py', ], capture_output=True,
text=True)
if chmod_process.returncode == 0:
print("\nChmod successful.\n")
else:
print("\nChmod failed\n")
run_process = subprocess.run(['python3', "/root/Config-server/6TO4-GRE-IPIP-SIT/ipipv2.py"])
def chisel():
from Chisel_multipleServers import chisel # noqa
def hawshemi():
chmod_process = subprocess.run(["chmod", '+x', '/Linux-Optimizer/linux-optimizer.sh', ], capture_output=True,
text=True)
if chmod_process.returncode == 0:
print("\nChmod successful.\n")
else:
print("\nChmod failed\n")
run_process = subprocess.run(['bash', "./Linux-Optimizer/linux-optimizer.sh"])
def op_iran():
chmod_process = subprocess.run(["chmod", '+x', '/VPS-Optimizer/optimizer.sh'], capture_output=True, text=True)
if chmod_process.returncode == 0:
print("\nChmod successful.\n")
else:
print("\nChmod failed\n")
run_process = subprocess.run(['bash', "./VPS-Optimizer/optimizer.sh"])
def rathole_compile():
chmod_process = subprocess.run(["chmod", '+x', '/Rathole_reverseTunnel/install.sh'], capture_output=True, text=True)
if chmod_process.returncode == 0:
print("\nchmod successful.\n")
else:
print("\nchmod failed\n")
run_process = subprocess.run(['bash', "./Rathole_reverseTunnel/install.sh"])
def rathole_install():
chmod_process = subprocess.run(["chmod", '+x', '/Rathole_reverseTunnel/go.sh'], capture_output=True, text=True)
if chmod_process.returncode == 0:
print("\nchmod successful.\n")
else:
print("\nchmod failed\n")
run_process = subprocess.run(['bash', "./Rathole_reverseTunnel/go.sh"])
def run_private():
chmod_process = subprocess.run(["chmod", '+x', '/root/Config-server/PrivateIP_TCP-UDP_Tunnel/Private.sh'],
capture_output=True, text=True)
if chmod_process.returncode == 0:
print("\nchmod successful.\n")
else:
print("\nchmod failed\n")
run_process = subprocess.run(['bash', "/root/Config-server/PrivateIP_TCP-UDP_Tunnel/Private.sh"])
def run_gost():
chmod_process = subprocess.run(["chmod", '+x', '/root/Config-server/Gost-ip6/Gost.sh'], capture_output=True,
text=True)
if chmod_process.returncode == 0:
print("\nchmod successful.\n")
else:
print("\nchmod failed\n")
run_process = subprocess.run(['bash', "/root/Config-server/Gost-ip6/Gost.sh"])
def install_mh():
print("enter your version:( example: 2.2.1 ):", end=' ')
version = 'v' + input()
chmod_process = subprocess.run(["chmod", '+x', './3x-ui/install.sh'], capture_output=True, text=True)
if chmod_process.returncode == 0:
print("\nchmod successful.\n")
else:
print("\nchmod failed\n")
run_process = subprocess.run(['bash', "./3x-ui/install.sh", version])
def install_alireza():
print("enter your version:( example: 2.2.1 ):", end=' ')
version = input()
run_process = subprocess.run(['bash', "./x-ui/install.sh", version])
def change_ssh():
chmod_process = subprocess.run(["chmod", '+x', 'change-ssh-port.sh'], capture_output=True, text=True)
if chmod_process.returncode == 0:
print("\nchmod successful.\n")
else:
print("\nchmod failed\n")
run_process = subprocess.run(['bash', "change-ssh-port.sh"])
if __name__ == '__main__':
while True:
subprocess.run(['curl', "-s",
"https://raw.githubusercontent.com/shinya/pokemon-terminal-art/main/256color/silver/001.txt"])
print("\n1. Linux optimizer ")
print("2. Tunnel server ")
print("3. Install x-ui panel")
print("4. Config UFW")
print("5. Change SSH port")
print("6. SSL certificate")
print("7. Iran firewall")
print("8. X-UI Backup")
print("9. Change NameServer")
print("0. Exit")
print("\nEnter your number:", end=" ")
num = int(input())
if num == 1:
print("\n1. Hawshemi optimizer")
print("2. OPIRAN optimizer")
print("0. Exit")
print("\nEnter your number:", end=" ")
num2 = int(input())
if num2 == 1:
hawshemi()
if num2 == 2:
op_iran()
if num2 == 0:
continue
if num == 2:
print("\n1. Rathole")
print("2. Chisel")
print("3. Gost ")
print("4. other tunnels")
print("0. Exit")
print("\nEnter your number:", end=" ")
num2 = int(input())
if num2 == 1:
print("\n1. Compile Rathole")
print("2. Setup Rathole")
print("0. Exit")
print("\nEnter your number:", end=" ")
num3 = int(input())
if num3 == 1:
rathole_compile()
if num3 == 2:
rathole_install()
if num3 == 0:
continue
if num2 == 2:
chisel()
if num2 == 3:
run_gost()
if num2 == 4:
other_tunnel()
if num2 == 0:
continue
if num == 3:
print("\n1. Mhsanaei")
print("2. Alireza")
print("0. Exit")
print("\nEnter your number:", end=" ")
num2 = int(input())
if num2 == 1:
install_mh()
if num2 == 2:
install_alireza()
if num2 == 0:
continue
if num == 4:
ufwrun()
if num == 5:
change_ssh()
if num == 6:
takessl()
if num == 7:
firewall()
if num == 8:
backup_do()
if num == 9:
dns()
if num == 0:
break