Last active
December 26, 2016 21:05
-
-
Save zobzn/2869741a57cd5d4124685018a9348212 to your computer and use it in GitHub Desktop.
dockerhost
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/bash | |
if [[ -z $(grep dockerhost /etc/hosts) ]] | |
then | |
echo $(printf "%d." $(echo $(awk '$2 == "00000000" {print $3}' /proc/net/route) | sed 's/../0x& /g' | tr ' ' '\n' | tac) | sed 's/\.$/\n/') dockerhost >> /etc/hosts | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment