Last active
June 22, 2017 22:13
-
-
Save preetapan/70b918e03be2b82a2b1f0e732f039b1e to your computer and use it in GitHub Desktop.
testing consul watches
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
//agent config file with watch handler | |
{ | |
"advertise_addr": "127.0.0.1", | |
"bind_addr": "127.0.0.1", | |
"data_dir":"/tmp/consultest", | |
"datacenter":"mydc", | |
"ui":true, | |
"server":true, | |
"watches":[ | |
{ | |
"type": "key", | |
"key": "test", | |
"handler": "/home/preetha/watch_handler.sh" | |
} | |
] | |
} | |
//contents of watch handler script (it echoes the input, nothing fancy) | |
#! /bin/bash | |
[ $# -ge 1 -a -f "$1" ] && input="$1" || input="-" | |
cat $input | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment