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