Created
January 4, 2020 03:13
-
-
Save GINK03/6528e527419bfde7913265bf8adb5931 to your computer and use it in GitHub Desktop.
medium_softether_vpn.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USERNAME = input('USERNAMEを指定してください:') | |
PASSWORD = input('PASSWORDを指定してください:') | |
PSK = input('PSKのパスワードを指定してください:') | |
query = \ | |
['docker', | |
'run', | |
'-d', | |
'--cap-add', | |
'NET_ADMIN', | |
'-p', | |
'500:500/udp', | |
'-p', | |
'4500:4500/udp', | |
'-p', | |
'1701:1701/tcp', | |
'-p', | |
'1194:1194/udp', | |
'-p', | |
'5555:5555/tcp', | |
'-e', | |
f'USERNAME={USERNAME}', | |
'-e', | |
f'PASSWORD={PASSWORD}', | |
'-e', | |
f'PSK={PSK}', | |
'siomiz/softethervpn'] | |
with Popen(query, stdout=PIPE, stdin=PIPE) as proc: | |
proc.wait(timeout=60) | |
reader = io.TextIOWrapper(proc.stdout) | |
while True: | |
r = reader.read(1) | |
if not r: | |
break | |
print(r, end='', flush=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment