forked from jeremiehuchet/docker-proxy-relay
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker_proxy.sh
More file actions
executable file
·41 lines (36 loc) · 795 Bytes
/
docker_proxy.sh
File metadata and controls
executable file
·41 lines (36 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
set -e
# defaults
domain=
proxy_user=
proxy_pass=
proxy_host=
proxy_port=
test -f ntlm_proxy.config && . ntlm_proxy.config
case "$1" in
start)
read -p "$proxy_host:$proxy_port username: ($proxy_user) " input && proxy_user="${input:-$proxy_user}"
read -s -p "$proxy_user@$proxy_host:$proxy_port password: " proxy_pass && echo
docker run --name docker-proxy -d --net=host \
-e username=$proxy_user \
-e domain=$domain \
-e password=$proxy_pass \
-e proxy=$proxy_host:$proxy_port \
docker-proxy-relay:1.0
;;
stop)
docker stop docker-proxy || docker kill docker-proxy
docker rm docker-proxy
;;
status)
docker ps | head -1
docker ps | grep docker-proxy
;;
*)
cat <<EOF
Usage: $0 start
$0 stop
$0 status
EOF
;;
esac