-
Notifications
You must be signed in to change notification settings - Fork 87
Expand file tree
/
Copy pathinstall.py
More file actions
217 lines (154 loc) · 6.23 KB
/
Copy pathinstall.py
File metadata and controls
217 lines (154 loc) · 6.23 KB
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
#!/usr/bin/python3
from torngconf.theme import *
from time import sleep
from os import geteuid, system, path, name
from subprocess import getoutput
def banner():
print(the_banner)
print(language.description)
def check_windows_check_root():
if name == "nt":
print(English.sorry_windows)
exit()
if geteuid() != 0:
print(language.root_please)
exit()
def check_lang():
try:
if path.isfile('torngconf/langconf.txt') == True:
with open('torngconf/langconf.txt') as file_lang:
language = eval(file_lang.readline())
file_lang.close()
print(language.applying_language, end='', flush=True)
print(language.done)
return language
else:
language = choose_lang()
return language
except KeyboardInterrupt:
print()
exit()
except (NameError, SyntaxError, AttributeError):
language = choose_lang()
return language
except FileNotFoundError:
print("TorghostNG is lacking its needed files. Reinstall TorghostNG from Github pls")
exit()
def choose_lang(language=English):
try:
with open('torngconf/langconf.txt', mode="w") as file_lang:
print(language.language_list)
choice = int(input(language.choose_your_lang))
if choice == 1:
print(English.applying_language)
file_lang.write("English")
language = English
elif choice == 2:
print(Vietnamese.applying_language)
file_lang.write("Vietnamese")
language = Vietnamese
else:
print()
print(language.invalid_choice)
choose_lang()
file_lang.close()
return language
except KeyboardInterrupt:
print()
exit()
def uninstall():
try:
choice = str(input(language.wanna_uninstall))
if choice[0].upper() == "Y":
print(language.uninstalling)
system('rm -rf /usr/bin/torngconf')
system('rm /usr/bin/torghostng')
print(language.uninstalled)
else:
print(language.torghostng_tip.format('torghostng') + color.END)
print(language.video_tutorials)
exit()
except KeyboardInterrupt:
print()
exit()
language = check_lang()
check_windows_check_root()
banner()
if path.isfile('/usr/bin/torghostng') == True:
print(language.already_installed.format('TorghostNG'))
uninstall()
if path.isfile('/usr/bin/pacman') == True:
INSTALL_PACKAGES = "pacman -S "
elif path.isfile('/usr/bin/apt') == True:
INSTALL_PACKAGES = "apt install "
elif path.isfile('/usr/bin/dnf') == True:
INSTALL_PACKAGES = "dnf install "
elif path.isfile('/usr/bin/yum') == True:
INSTALL_PACKAGES = "yum install "
elif path.isfile('/usr/bin/zypper') == True:
INSTALL_PACKAGES = "zypper install "
elif path.isfile('/usr/bin/xbps-install') == True:
INSTALL_PACKAGES = "xbps-install -S "
elif path.isfile('/usr/bin/upgradepkg') == True:
UPDATE_REPOSITORY = "wget https://slack.conraid.net/repository/slackware64-current"
INSTALL_PACKAGES = "upgradepkg --install-new "
else:
print(language.sorry_some_os)
exit()
def install_package(package):
try:
if path.isfile('/usr/bin/'+package) == True:
print(language.already_installed.format(package))
else:
print(language.installing.format(package))
if path.isfile('/usr/bin/upgradepkg') == True:
print(language.downloading.format(package))
if package == 'tor':
system(UPDATE_REPOSITORY + 'tor/tor-0.4.2.7-x86_64-1cf.txz')
system(INSTALL_PACKAGES + 'tor-0.4.2.7-x86_64-1cf.txz')
elif package == 'macchanger':
system(UPDATE_REPOSITORY + 'macchanger/macchanger-1.7.0-x86_64-5cf.txz')
system(INSTALL_PACKAGES + 'macchanger-1.7.0-x86_64-5cf.txz')
elif package == 'pip3':
system('wget https://packages.slackonly.com/pub/packages/14.1-x86_64/python/python3/python3-3.5.1-x86_64-1_slack.txz')
system(INSTALL_PACKAGES + 'python3-3.5.1-x86_64-1_slack.txz')
else:
if package == 'pip3':
package = 'python3-pip'
if path.isfile('/usr/bin/pacman') == True:
package = 'python-pip'
system(INSTALL_PACKAGES + package)
print(icon.success + language.done)
print(language.installed.format(package))
if path.isfile('/usr/bin/upgradepkg') == True:
print(language.torghostng_tip.format('python3 torghostng.py'))
print(language.video_tutorials)
exit()
except KeyboardInterrupt:
print()
exit()
def pyinstaller():
try:
system('pip2 uninstall pyinstaller')
if path.isfile('/usr/bin/pyinstaller') == True:
print(language.already_installed.format('PyInstaller'))
else:
print(language.installing.format('PyInstaller'))
system('pip3 install pyinstaller')
print(icon.success + language.done)
print(language.installed.format('PyInstaller'))
print(language.installing.format('TorghostNG'))
system('pyinstaller --onefile torghostng.py')
system('cp -r dist/torghostng /usr/bin && cp -r torngconf /usr/bin')
system('chmod +x /usr/bin/torghostng')
print(icon.success + language.done)
print(language.torghostng_tip.format('torghostng') + color.END)
except KeyboardInterrupt:
print()
exit()
packages = ['tor','macchanger','pip3']
for package in packages:
install_package(package)
pyinstaller()
print(language.video_tutorials)
exit()