Created
November 29, 2017 21:20
-
-
Save qvicksilver/d3ed3d927ce380282fb91a79336f1511 to your computer and use it in GitHub Desktop.
This file contains 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/sh | |
#/etc/NetworkManager/dispatcher.d/02-docker-dns | |
case $1 in | |
eth0|wlan0) | |
case $2 in | |
up) | |
dns=$(echo $IP4_NAMESERVERS | awk -F, '{ for(i = 1; i <= NF; i++) { print "\""$i"\""; } }'|paste -d, -s) | |
sed -i 's/.*dns.*/ "dns": ['$dns'],/' /etc/docker/daemon.json | |
systemctl restart docker | |
;; | |
*) | |
;; | |
esac | |
;; | |
*) | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment