Created
September 15, 2014 19:31
-
-
Save claudyus/66dd8360b505d4ea7b50 to your computer and use it in GitHub Desktop.
LXC name in hostsfile
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 | |
sed -i '/^#LXC$/,/^#END LXC$/d' /etc/hosts | |
echo "#LXC" >> /etc/hosts | |
lxc-ls -1 --fancy -F ipv4,name | grep -o ^[0-9].* >> /etc/hosts | |
echo "#END LXC" >> /etc/hosts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment