-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
install.py
78 lines (76 loc) · 2.67 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
74
75
76
77
78
import os
import sys
from time import sleep
from quo import clear
from quo.prompt import Prompt
from quo.text import Text
from src.outlook import *
from src.system import *
session = Prompt()
class tool:
@classmethod
def install(self):
while True:
system=sys()
clear()
logo.ins_tnc()
session = Prompt(bottom_toolbar=Text(' <b>Install</b> <style bg="red">sashay</style>'), placeholder=Text(' <gray>([y/n])</gray>'))
inp= session.prompt("Do you want to install sashay?:")
if inp=="y" or inp=="Y" or inp=="Yes" or inp=="yes":
clear()
logo.installing()
if system.sudo is not None:
#require root permission
if os.path.exists(system.conf_dir+"/sashay"):
pass
else:
os.system(system.sudo+" mkdir "+system.conf_dir+"/sashay")
os.system(system.sudo+" cp -r src assets sashay.py "+system.conf_dir+"/sashay")
os.system(system.sudo+" cp -r assets/sashay "+system.bin)
os.system(system.sudo+" cp -r assets/sshy "+system.bin)
os.system(system.sudo+" chmod +x "+system.bin+"/sashay")
os.system(system.sudo+" chmod +x "+system.bin+"/sshy")
os.system("cd .. && "+system.sudo+" rm -rf sashay")
if os.path.exists(system.bin+"/sashay") and os.path.exists(system.conf_dir+"/sashay"):
clear()
logo.ins_sc()
tmp = session.prompt("|>>")
# tmp=input("\033[1;36m ##> \033[00m")
break
else:
clear()
logo.not_ins()
tmp = session.prompt("|>>")
# tmp=input("\033[1;36m ##> \033[00m")
break
else:
if os.path.exists(system.conf_dir+"/sashay"):
pass
else:
os.system("mkdir "+system.conf_dir+"/sashay")
os.system("cp -r src assets sashay.py "+system.conf_dir+"/sashay")
os.system("cp -r assets/sashay "+system.bin)
os.system("cp -r assets/sshy "+system.bin)
os.system("chmod +x "+system.bin+"/sashay")
os.system("chmod +x "+system.bin+"/sshy")
os.system("cd .. && rm -rf sashay")
if os.path.exists(system.bin+"/sashay") and os.path.exists(system.conf_dir+"/sashay"):
clear()
logo.ins_sc()
tmp = session.prompt("|>>")
# tmp=input("\033[1;36m ##> \033[00m")
break
else:
clear()
logo.not_ins()
tmp=session.prompt("|>>")
# tmp=input("\033[1;36m ##> \033[00m")
break
else:
break
if __name__=="__main__":
try:
tool.install()
except KeyboardInterrupt:
clear()
logo.exit()