-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathChecks.py
More file actions
99 lines (91 loc) · 4.51 KB
/
Checks.py
File metadata and controls
99 lines (91 loc) · 4.51 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
import subprocess
import ctypes
#import requests
import urllib
#from urllib import urlopen
from os import system, getuid, path
from time import sleep
from platform import system as systemos, architecture
from subprocess import check_output
RED, WHITE, CYAN, GREEN, DEFAULT , YELLOW, YELLOW2, GREEN2= '\033[91m', '\033[46m', '\033[36m', '\033[1;32m', '\033[0m' , '\033[1;33m' , '\033[1;93m', '\033[1;92m'
def checkwget():
system('clear')
if 256 != system('which wget > /dev/null'):
print(" {0}[{2}*{0}] {2}WGET INSTALLATION FOUND....".format(RED, WHITE, CYAN, GREEN, DEFAULT ,YELLOW))
sleep(3)
else:
print("{0}[{2}*{0}] {2}WGET NOT FOUND\n {0}[{2}*{0}] {2}Installing PHP... ".format(RED, WHITE, CYAN, GREEN, DEFAULT ,YELLOW))
system('apt-get install wget > /dev/null')
exit()
def checkPHP():
if 256 != system('which php > /dev/null'):
print(" {0}[{2}*{0}] {2}PHP INSTALLATION FOUND...".format(RED, WHITE, CYAN, GREEN, DEFAULT ,YELLOW))
sleep(3)
else:
print("{0}[{2}*{0}] {2}PHP NOT FOUND\n {0}[{2}*{0}] {2}Installing PHP... ".format(RED, WHITE, CYAN, GREEN, DEFAULT ,YELLOW))
system('apt-get install php > /dev/null')
exit()
def checkNgrok():
if path.isfile('Server/ngrok') == False:
print(' {0}[{2}*{0}]{2} Ngrok Not Found {0}!!'.format(RED, WHITE, CYAN, GREEN, DEFAULT ,YELLOW))
print(' {0}[{2}*{0}]{2} Downloading Ngrok...{5}'.format(RED, WHITE, CYAN, GREEN, DEFAULT ,YELLOW))
if 'Android' in str(check_output(('uname', '-a'))) or 'arm' in str(check_output(('uname', '-a'))):
filename = 'ngrok-stable-linux-arm.zip'
url = 'https://bin.equinox.io/c/4VmDzA7iaHb/' + filename
req=system('wget {0}'.format(url))
#with open(filename, "wb") as file_obj:
#file_obj.write(req.content)
system('unzip ' + filename)
system('mv ngrok Server/ngrok')
system('rm ' + filename)
system('chmod +x ngrok')
system('clear')
print("{4} ".format(GREEN, DEFAULT, RED))
else:
ostype = systemos().lower()
if architecture()[0] == '64bit':
filename = 'ngrok-stable-{0}-amd64.zip'.format(ostype)
else:
filename = 'ngrok-stable-{0}-386.zip'.format(ostype)
url = 'https://bin.equinox.io/c/4VmDzA7iaHb/' + filename
req=system('wget {0}'.format(url))
#with open(filename, "wb") as file_obj:
#file_obj.write(req.content)
system('unzip ' + filename)
system('mv ngrok Server/ngrok')
system('rm ' + filename)
system('clear')
print("{4} ".format(RED, WHITE, CYAN, GREEN, DEFAULT ,YELLOW))
else:
print(" {0}[{2}*{0}] {2}NGROK INSTALLATION FOUND......".format(RED, WHITE, CYAN, GREEN, DEFAULT ,YELLOW))
sleep(1)
def checkLocalxpose():
if path.isfile('Server/loclx') == False:
print(' {0}[{2}*{0}]{2} Localxpose Not Found {0}!!'.format(RED, WHITE, CYAN, GREEN, DEFAULT ,YELLOW))
print(' {0}[{2}*{0}]{2} Downloading Localxpose...{5}'.format(RED, WHITE, CYAN, GREEN, DEFAULT ,YELLOW))
if 'Android' in str(check_output(('uname', '-a'))) or 'arm' in str(check_output(('uname', '-a'))):
filename = 'loclx-linux-arm.zip'
url = 'https://lxpdownloads.sgp1.digitaloceanspaces.com/cli/'+filename
req=system('wget {0}'.format(url))
#with open("{0}", "wb".format(filename)) as file_obj:
#file_obj.write(req.content)
system('unzip {0} && rm {0}'.format(filename))
system('mv loclx-linux-* loclx && mv loclx Server/')
system('chmod +x loclx')
print("{4} ".format(RED, WHITE, CYAN, GREEN, DEFAULT ,YELLOW))
else:
ostype = systemos().lower()
if architecture()[0] == '64bit':
filename = 'loclx-linux-amd64.zip'.format(ostype)
else:
filename = 'loclx-linux-386.zip'.format(ostype)
url = 'https://lxpdownloads.sgp1.digitaloceanspaces.com/cli/'+filename
req=system('wget {0}'.format(url))
#with open("{0}", "wb".format(filename)) as file_obj:
#file_obj.write(req.content)
system('unzip {0} && rm {0}'.format(filename))
system('mv loclx-linux-* loclx && mv loclx Server/')
print("{1} ".format(GREEN, DEFAULT, RED))
else:
print(" {0}[{2}*{0}] {2}LOCALXPOSE INSTALLATION FOUND.....".format(RED, WHITE, CYAN, GREEN, DEFAULT ,YELLOW))
sleep(1)