You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
414 B
15 lines
414 B
import subprocess |
|
import requests |
|
from time import sleep |
|
|
|
subprocess.run(['sudo', 'wg-quick', 'down', 'integrity']) |
|
|
|
with open('ip.txt', 'a+') as f: |
|
while True: |
|
subprocess.run(['wg-quick', 'up', 'integrity'] ) |
|
sleep(5) |
|
ip = requests.get('https://api.ipify.org').text |
|
print(ip) |
|
f.write(f'{ip}\n') |
|
subprocess.run(['wg-quick', 'down', 'integrity']) |
|
sleep(5) |