forked from ekadanuarta/Tool-X
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.py
73 lines (70 loc) · 2.48 KB
/
install.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
import os
import sys
from time import sleep
from modules.logo import *
from modules.system import *
yellow="\033[1;33m"
blue="\033[1;34m"
nc="\033[00m"
class tool:
@classmethod
def install(self):
while True:
system=sys()
os.system("clear")
logo.ins_tnc()
inp=input(f"{yellow}Do you want to install Tool-X [Y/n]> {nc}")
if inp=="y" or inp=="Y":
os.system("clear")
logo.installing()
if system.sudo is not None:
#require root permission
if os.path.exists(system.conf_dir+"/Tool-X"):
pass
else:
os.system(system.sudo+" mkdir "+system.conf_dir+"/Tool-X")
os.system(system.sudo+" cp -r modules core Tool-X.py "+system.conf_dir+"/Tool-X")
os.system(system.sudo+" cp -r core/Tool-X "+system.bin)
os.system(system.sudo+" cp -r core/toolx "+system.bin)
os.system(system.sudo+" chmod +x "+system.bin+"/Tool-X")
os.system(system.sudo+" chmod +x "+system.bin+"/toolx")
os.system("cd .. && "+system.sudo+" rm -rf Tool-X")
if os.path.exists(system.bin+"/Tool-X") and os.path.exists(system.conf_dir+"/Tool-X"):
os.system("clear")
logo.ins_sc()
tmp=input(f"{blue}Tool-X{nc}@{blue}space {yellow}$ {nc}")
break
else:
os.system("clear")
logo.not_ins()
tmp=input(f"{blue}Tool-X{nc}@{blue}space {yellow}$ {nc}")
break
else:
if os.path.exists(system.conf_dir+"/Tool-X"):
pass
else:
os.system("mkdir "+system.conf_dir+"/Tool-X")
os.system("cp -r modules core Tool-X.py "+system.conf_dir+"/Tool-X")
os.system("cp -r core/Tool-X "+system.bin)
os.system("cp -r core/toolx "+system.bin)
os.system("chmod +x "+system.bin+"/Tool-X")
os.system("chmod +x "+system.bin+"/toolx")
os.system("cd .. && rm -rf Tool-X")
if os.path.exists(system.bin+"/Tool-X") and os.path.exists(system.conf_dir+"/Tool-X"):
os.system("clear")
logo.ins_sc()
tmp=input(f"{blue}Tool-X{nc}@{blue}space {yellow}$ {nc}")
break
else:
os.system("clear")
logo.not_ins()
tmp=input(f"{blue}Tool-X{nc}@{blue}space {yellow}$ {nc}")
break
else:
break
if __name__=="__main__":
try:
tool.install()
except KeyboardInterrupt:
os.system("clear")
logo.exit()