-
Notifications
You must be signed in to change notification settings - Fork 0
/
UPDATE.py
58 lines (48 loc) · 1.33 KB
/
UPDATE.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
import os
import time
import sys
class cd:
def __init__(self, newPath):
self.newPath = os.path.expanduser(newPath)
def __enter__(self):
self.savedPath = os.getcwd()
os.chdir(self.newPath)
def __exit__(self, etype, value, traceback):
os.chdir(self.savedPath)
try:
os.system("clear")
os.system('figlet LAZY UPDATER')
print("")
update = raw_input("You want to update stupidlazy and NMAPer? yes/no: ")
if update == "yes":
print("GIT CLONING...")
os.system("git clone https://github.com/AzgarDev/StupidLazy.git")
time.sleep(5)
print("REMOVING OLD VERSIONS.")
os.system("rm -rf stupidlazy.py")
os.system("rm -rf NMAPer.py")
os.system("rm -rf page2.py")
time.sleep(0.5)
print("COPING NEW FILES")
with cd("StupidLazy"):
os.system("cp stupidlazy.py ../")
time.sleep(0.5)
os.system("cp NMAPer.py ../")
time.sleep(0.5)
os.system("cp page2.py ../")
os.system("cd ..")
os.system("rm -rf StupidLazy")
print("DONE")
sys.exit()
if update == "no":
os.system("python stupidlazy.py")
else:
print("Please enter a valid value.")
time.sleep(2)
os.system("python UPDATE.py")
except Exception:
print("Please enter a valid value.")
time.sleep(2)
os.system("python UPDATE.py")
except KeyboardInterrupt:
os.system("python stupidlazy.py")