Skip to content

Commit

Permalink
Moved helper scripts for git to a proper place
Browse files Browse the repository at this point in the history
socks5proxyssh => socksified-ssh.sh
socks5proxywrapper => socksified-connect.sh
  • Loading branch information
zjx20 committed Mar 18, 2017
1 parent f74944e commit 5d1059b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions activate
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ else
BEFORE_ENV="$(env)"

# For "git" protocol
export GIT_PROXY_COMMAND="${CURRENT_DIR}/socks5proxywrapper"
export GIT_PROXY_COMMAND="${CURRENT_DIR}/sh/socksified-connect.sh"
# For "ssh" protocol
export GIT_SSH="${CURRENT_DIR}/socks5proxyssh"
export GIT_SSH="${CURRENT_DIR}/sh/socksified-ssh.sh"
# For "http/https" protocol
export ALL_PROXY="socks5h://${SOCKS_PROXY}"

Expand Down
3 changes: 2 additions & 1 deletion deactivate
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ if [ "${_socks_git}" = "1" ]; then
if [ -n "${!VAR+x}" ]; then
echo "export $1=\"\${${VAR}}\"; unset ${VAR}"
else
# Check if the variable exists, for security
# Check if the variable really exists, for security.
# e.g. to avoid code injection or something else.
[ -n "${!1+x}" ] && echo "unset $1"
fi
fi
Expand Down
Empty file modified py/connect.py
100644 → 100755
Empty file.
7 changes: 7 additions & 0 deletions sh/socksified-connect.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "${CURRENT_DIR}"
if [ -z "${SOCKS_PROXY}" ]; then
source ../socksproxyenv
fi
../py/connect.py -s ${SOCKS_PROXY} "$@"
2 changes: 1 addition & 1 deletion socks5proxyssh → sh/socksified-ssh.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ssh -o ProxyCommand="${CURRENT_DIR}/socks5proxywrapper %h %p" "$@"
ssh -o ProxyCommand="${CURRENT_DIR}/socksified-connect.sh %h %p" "$@"
6 changes: 0 additions & 6 deletions socks5proxywrapper

This file was deleted.

0 comments on commit 5d1059b

Please sign in to comment.