Fix docker_db.sh userland proxy disabling

This commit is contained in:
Christian Beikov 2023-10-20 10:21:18 +02:00
parent 5b5bc30644
commit f88da832bb
1 changed files with 3 additions and 3 deletions

View File

@ -619,14 +619,14 @@ EOF\""
disable_userland_proxy() {
if [[ "$HEALTCHECK_PATH" == "{{.State.Health.Status}}" ]]; then
if [[ ! -f /etc/docker/daemon.json ]]; then
if ! sudo test -f /etc/docker/daemon.json; then
sudo service docker stop
sudo bash -c "echo '{\"userland-proxy\": false}' > /etc/docker/daemon.json"
sudo service docker start
elif ! grep -q userland-proxy /etc/docker/daemon.json; then
elif ! sudo grep -q userland-proxy /etc/docker/daemon.json; then
export docker_daemon_json=$(</etc/docker/daemon.json)
sudo service docker stop
sudo bash -c 'echo "${docker_daemon_json/\}/,}{\"userland-proxy\": false}" > /etc/docker/daemon.json'
sudo bash -c 'echo "${docker_daemon_json/\}/,}\"userland-proxy\": false}" > /etc/docker/daemon.json'
sudo service docker start
fi
fi