mirror of
https://github.com/mietzen/docker-redsocks-proxy.git
synced 2025-01-05 22:19:54 +03:00
Don't add static block again
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
server_names = [$DOH_SERVERS]
|
||||
server_names = [$DOH_SERVER_LIST]
|
||||
listen_addresses = ['127.0.0.1:5533']
|
||||
doh_servers = true
|
||||
force_tcp = true
|
||||
|
||||
@@ -42,6 +42,9 @@ setup_dnscrypt() {
|
||||
|
||||
RESOLVERS_JSON=$(curl -s https://download.dnscrypt.info/dnscrypt-resolvers/json/public-resolvers.json)
|
||||
DOH_SERVERS=$(echo "$DOH_SERVERS" | sed 's/[[:space:]]//g')
|
||||
export DOH_SERVER_LIST=$(echo "$DOH_SERVERS" | sed "s/\([^,]*\)/'\1'/g" | sed 's/,/, /g')
|
||||
envsubst < /opt/dnscrypt/dnscrypt-config.toml.template > /opt/dnscrypt/dnscrypt-config.toml
|
||||
|
||||
STATIC_BUFFER=""
|
||||
IFS=',' read -ra SERVERS <<< "$DOH_SERVERS"
|
||||
echo " - Querying dns static stamps:"
|
||||
@@ -57,15 +60,13 @@ setup_dnscrypt() {
|
||||
fi
|
||||
done
|
||||
if [[ -n "$STATIC_BUFFER" ]]; then
|
||||
echo "[static]" >> /opt/dnscrypt/dnscrypt-config.toml.template
|
||||
echo -e "$STATIC_BUFFER" >> /opt/dnscrypt/dnscrypt-config.toml.template
|
||||
echo "[static]" >> /opt/dnscrypt/dnscrypt-config.toml
|
||||
echo -e "$STATIC_BUFFER" >> /opt/dnscrypt/dnscrypt-config.toml
|
||||
else
|
||||
echo " - No valid stamps found; skipping [static] block."
|
||||
fi
|
||||
|
||||
export DOH_SERVERS=$(echo "$DOH_SERVERS" | sed "s/\([^,]*\)/'\1'/g" | sed 's/,/, /g')
|
||||
|
||||
envsubst < /opt/dnscrypt/dnscrypt-config.toml.template > /opt/dnscrypt/dnscrypt-config.toml
|
||||
echo " - DNSCrypt configuration:"
|
||||
sed '$d' /opt/dnscrypt/dnscrypt-config.toml | sed 's/^/ /'
|
||||
su -s /bin/sh -c "touch /opt/dnscrypt/dnscrypt.log" dnscrypt
|
||||
|
||||
Reference in New Issue
Block a user