Last active
November 17, 2017 17:42
-
-
Save rafaelgaspar/27370074f0887114208ff6905b581572 to your computer and use it in GitHub Desktop.
Migrate from Consul o Etcd
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 | |
for key in $(consul kv export | grep "\"key\":" | sed "s/^\t*\"key\": \"//g" | sed "s/\",$//g") | |
do | |
echo $key: | |
consul kv get $key | |
echo | |
done |
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 | |
for key in $(consul kv export | grep "\"key\":" | sed "s/^\t*\"key\": \"//g" | sed "s/\",$//g") | |
do | |
curl -XPUT http://etcd:2379/v2/keys/$key -d value="$(consul kv get $key)" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment