mirror of
https://github.com/samply/bridgehead.git
synced 2025-08-07 18:00:21 +02:00
Added proxy user + pw detection
This commit is contained in:
@@ -9,6 +9,17 @@ detectCompose() {
|
||||
fi
|
||||
}
|
||||
|
||||
setupProxy() {
|
||||
if [[ ! -z "$HTTP_PROXY_USERNAME" && ! -z "$HTTP_PROXY_PASSWORD" ]]; then
|
||||
log "INFO" "Detected proxy user and password"
|
||||
PROTO="$(echo $HTTP_PROXY_URL | grep :// | sed -e's,^\(.*://\).*,\1,g')"
|
||||
URL="$(echo ${HTTP_PROXY_URL/$PROTO/})"
|
||||
PROXY="$(echo $PROTO$HTTP_PROXY_USERNAME:$HTTP_PROXY_PASSWORD@$URL)"
|
||||
else
|
||||
PROXY=$HTTP_PROXY_URL
|
||||
fi
|
||||
}
|
||||
|
||||
exitIfNotRoot() {
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
log "ERROR" "Please run as root"
|
||||
|
Reference in New Issue
Block a user