clash-linux commited on
Commit
f80fee9
·
verified ·
1 Parent(s): c99d2c6

Upload 17 files

Browse files
Files changed (1) hide show
  1. entrypoint.sh +7 -7
entrypoint.sh CHANGED
@@ -1,16 +1,16 @@
1
  #!/bin/sh
2
  set -e
3
 
4
- # This script configures and runs the application with proxychains if PROXY_URL is set.
5
  # It is designed to be the ENTRYPOINT of a Docker container.
6
 
7
- if [ -n "$PROXY_URL" ]; then
8
- echo "PROXY_URL is set. Configuring proxychains..."
9
 
10
- # Extract details from PROXY_URL
11
  # Format: http://user:pass@host:port
12
- PROTO=$(echo "$PROXY_URL" | grep :// | sed -e's,^\(.*://\).*,\1,g' | sed -e 's,://,,g')
13
- URL_NO_PROTO=$(echo "$PROXY_URL" | sed -e 's,^.*://,,g')
14
  USER_PASS=$(echo "$URL_NO_PROTO" | grep -o '.*@' | sed 's/@//')
15
  HOST_PORT=$(echo "$URL_NO_PROTO" | sed -e "s,$USER_PASS@,,g")
16
  HOST=$(echo "$HOST_PORT" | cut -d: -f1)
@@ -49,7 +49,7 @@ EOF
49
  # Execute the command passed to the script, wrapped in proxychains
50
  exec proxychains4 "$@"
51
  else
52
- echo "PROXY_URL is not set. Starting application without proxy."
53
  # Execute the command as is
54
  exec "$@"
55
  fi
 
1
  #!/bin/sh
2
  set -e
3
 
4
+ # This script configures and runs the application with proxychains if STASTIC_PROXY is set.
5
  # It is designed to be the ENTRYPOINT of a Docker container.
6
 
7
+ if [ -n "$STASTIC_PROXY" ]; then
8
+ echo "STASTIC_PROXY is set. Configuring proxychains..."
9
 
10
+ # Extract details from STASTIC_PROXY
11
  # Format: http://user:pass@host:port
12
+ PROTO=$(echo "$STASTIC_PROXY" | grep :// | sed -e's,^\(.*://\).*,\1,g' | sed -e 's,://,,g')
13
+ URL_NO_PROTO=$(echo "$STASTIC_PROXY" | sed -e 's,^.*://,,g')
14
  USER_PASS=$(echo "$URL_NO_PROTO" | grep -o '.*@' | sed 's/@//')
15
  HOST_PORT=$(echo "$URL_NO_PROTO" | sed -e "s,$USER_PASS@,,g")
16
  HOST=$(echo "$HOST_PORT" | cut -d: -f1)
 
49
  # Execute the command passed to the script, wrapped in proxychains
50
  exec proxychains4 "$@"
51
  else
52
+ echo "STASTIC_PROXY is not set. Starting application without proxy."
53
  # Execute the command as is
54
  exec "$@"
55
  fi