Created
September 2, 2014 10:45
-
-
Save diasjorge/1f9238ef54ae0c83a5a6 to your computer and use it in GitHub Desktop.
Interact with riak attach
This file contains hidden or 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
#!/usr/bin/expect | |
# Debug info | |
# exp_internal 1 | |
set timeout 10 | |
log_user 0 | |
set path [lindex $argv 0] | |
if {[llength $argv] == 0} { | |
send_user "Suppy path as first argument\n" | |
exit 1 | |
} | |
send_user "\n#####\n#Adding $path\n#####\n" | |
spawn sudo riak attach | |
expect { | |
timeout { send_user "noway" } | |
"riak@*" { | |
send_user "connected" | |
send "code:add_patha(\"$path\").\n" | |
expect "true" | |
send "code:get_path().\n" | |
expect "$path" | |
send "" | |
} | |
} | |
close |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment