Last active
December 17, 2019 11:19
-
-
Save chriskalmar/bbba6e242b78fffcb3415c673e8c1b30 to your computer and use it in GitHub Desktop.
sync your digitalocean servers to your `/etc/hosts` file
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 | |
# install doctl and hostess before use: | |
# https://github.com/digitalocean/doctl | |
# https://github.com/cbednarski/hostess | |
# | |
# brew install doctl | |
# brew install hostess | |
PREFIX=yourdomain | |
sudo hostess fix | |
doctl compute droplet list | awk 'NR>1 {print $2" "$3}' | xargs -n2 -I {} bash -c "sudo hostess add $PREFIX.{}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment