small update

This commit is contained in:
2022-01-14 16:40:17 +01:00
parent 48727a7aa6
commit bd227f9c4b
2 changed files with 10 additions and 5 deletions

View File

@@ -11,6 +11,12 @@ import io
from PIL import Image
from bs4 import BeautifulSoup
def isPortInUse(port):
import socket
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
return s.connect_ex(('127.0.0.1', port)) == 0
def getAddress(interface="tun0"):
if not interface in ni.interfaces():
interfaces = ni.interfaces()