add comments
This commit is contained in:
4
init.py
4
init.py
@@ -2,13 +2,15 @@ from os.path import exists
|
||||
import requests
|
||||
from time import sleep
|
||||
|
||||
# bucle infinito
|
||||
while True:
|
||||
# Si está online
|
||||
req = requests.get("http://ipinfo.io/ip")
|
||||
while int(req.status_code) != 200:
|
||||
sleep(60)
|
||||
req = requests.get("http://ipinfo.io/ip")
|
||||
|
||||
ip = req.text
|
||||
|
||||
# existe archivo con la antigua ip
|
||||
file_exists = exists("old_ip.txt")
|
||||
if not file_exists:
|
||||
|
||||
Reference in New Issue
Block a user