mirror of
https://github.com/sshuttle/sshuttle.git
synced 2025-08-09 15:54:56 +02:00
MacOS precompiled app package for sshuttle-0.45
This commit is contained in:
28
Sshuttle VPN.app/Contents/Resources/askpass.py
Normal file
28
Sshuttle VPN.app/Contents/Resources/askpass.py
Normal file
@ -0,0 +1,28 @@
|
||||
import sys, os, re, subprocess
|
||||
|
||||
def askpass(prompt):
|
||||
prompt = prompt.replace('"', "'")
|
||||
|
||||
if 'yes/no' in prompt:
|
||||
return "yes"
|
||||
|
||||
script="""
|
||||
tell application "Finder"
|
||||
activate
|
||||
display dialog "%s" \
|
||||
with title "Sshuttle SSH Connection" \
|
||||
default answer "" \
|
||||
with icon caution \
|
||||
with hidden answer
|
||||
end tell
|
||||
""" % prompt
|
||||
|
||||
p = subprocess.Popen(['osascript', '-e', script], stdout=subprocess.PIPE)
|
||||
out = p.stdout.read()
|
||||
rv = p.wait()
|
||||
if rv:
|
||||
return None
|
||||
g = re.match("text returned:(.*), button returned:.*", out)
|
||||
if not g:
|
||||
return None
|
||||
return g.group(1)
|
Reference in New Issue
Block a user