This commit is contained in:
Usama Abdul Sattar 2018-10-30 16:48:02 +05:00 committed by GitHub
parent 9d6719fbf2
commit aa37e6465a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -97,6 +97,12 @@ def runNgrok():
def runServeo(): def runServeo():
system('ssh -o StrictHostKeyChecking=no -o ServerAliveInterval=60 -R 80:localhost:1111 serveo.net > link.url 2> /dev/null &') system('ssh -o StrictHostKeyChecking=no -o ServerAliveInterval=60 -R 80:localhost:1111 serveo.net > link.url 2> /dev/null &')
sleep(7) sleep(7)
with open('link.url') as creds:
lines = creds.read().rstrip()
if len(lines) != 0:
pass
else:
runServeo()
output = check_output("grep -o 'https://[0-9a-z]*\.serveo.net' link.url", shell=True) output = check_output("grep -o 'https://[0-9a-z]*\.serveo.net' link.url", shell=True)
url = str(output).strip("b ' \ n") url = str(output).strip("b ' \ n")
print("\n {0}[{1}*{0}]{1} SERVEO URL: {2}".format(RED, DEFAULT, GREEN) + url + "{1}".format(RED, DEFAULT, GREEN)) print("\n {0}[{1}*{0}]{1} SERVEO URL: {2}".format(RED, DEFAULT, GREEN) + url + "{1}".format(RED, DEFAULT, GREEN))