Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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
You can’t perform that action at this time.