Created
September 21, 2017 07:01
-
-
Save pcornier/e309769fcd9f6a91b2efb7829fd98365 to your computer and use it in GitHub Desktop.
Auto update docker DNS with reverse proxy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
IP=$(nmcli dev show wlp4s0 | grep DNS | grep -o "\w*\.\w*\.\w*\.\w*" | head -n 1) | |
sed -i "s/--dns=\w*\.\w*\.\w*\.\w*/--dns=$IP/" /etc/systemd/system/docker.service | |
systemctl daemon-reload | |
systemctl restart docker |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment