Fix cli.py install-hysteria2

This commit is contained in:
Sarina
2024-07-21 20:54:19 +03:30
parent 6f76b9717c
commit 11e206e16f
2 changed files with 15 additions and 4 deletions

10
core/validator.py Normal file
View File

@ -0,0 +1,10 @@
import os
def validate_port(p:int)-> bool:
if p < 1 or p > 65535:
return False
# check if port is in use
if os.system(f'lsof -i:{p}') == 0:
return False
return True