diff options
Diffstat (limited to 'plugins/shell-proxy')
-rwxr-xr-x | plugins/shell-proxy/proxy.py | 7 | ||||
-rw-r--r-- | plugins/shell-proxy/shell-proxy.plugin.zsh | 2 | ||||
-rwxr-xr-x | plugins/shell-proxy/ssh-agent.py | 2 |
3 files changed, 6 insertions, 5 deletions
diff --git a/plugins/shell-proxy/proxy.py b/plugins/shell-proxy/proxy.py index 2b62f6cb5..97f4cf873 100755 --- a/plugins/shell-proxy/proxy.py +++ b/plugins/shell-proxy/proxy.py @@ -9,8 +9,9 @@ user_proxy = os.environ.get("CONFIG_PROXY", os.path.expandvars("$HOME/.config/pr def get_http_proxy(): - if "DEFAULT_PROXY" in os.environ: - return os.environ["DEFAULT_PROXY"] + default_proxy = os.environ.get("DEFAULT_PROXY") + if default_proxy: + return default_proxy if os.path.isfile(user_proxy): return check_output(user_proxy).decode("utf-8").strip() raise Exception("Not found, Proxy configuration") @@ -30,7 +31,7 @@ def merge(mapping: dict): class CommandSet: proxies = make_proxies(get_http_proxy()) aliases = { - _: "env NAME=%s %s" % (_, ssh_agent) + _: "env __SSH_PROGRAM_NAME__=%s %s" % (_, ssh_agent) for _ in ("ssh", "sftp", "scp", "slogin", "ssh-copy-id") } diff --git a/plugins/shell-proxy/shell-proxy.plugin.zsh b/plugins/shell-proxy/shell-proxy.plugin.zsh index fd0e2fe79..315ade665 100644 --- a/plugins/shell-proxy/shell-proxy.plugin.zsh +++ b/plugins/shell-proxy/shell-proxy.plugin.zsh @@ -4,7 +4,7 @@ __PROXY__="${0:A:h}/proxy.py" proxy() { - source <("$__PROXY__" "$1") + source <(env "DEFAULT_PROXY=$DEFAULT_PROXY" "$__PROXY__" "$1") } _proxy() { diff --git a/plugins/shell-proxy/ssh-agent.py b/plugins/shell-proxy/ssh-agent.py index 61cf84c0b..4ee24b755 100755 --- a/plugins/shell-proxy/ssh-agent.py +++ b/plugins/shell-proxy/ssh-agent.py @@ -6,7 +6,7 @@ import sys ssh_proxy = os.path.join(os.path.dirname(__file__), "ssh-proxy.py") argv = [ - os.environ.get("NAME", "ssh"), + os.environ.get("__SSH_PROGRAM_NAME__", "ssh"), "-o", "ProxyCommand={} %h %p".format(ssh_proxy), "-o", |