Skip to content

Instantly share code, notes, and snippets.

@diasjorge
Created September 2, 2014 10:45
Show Gist options
  • Save diasjorge/1f9238ef54ae0c83a5a6 to your computer and use it in GitHub Desktop.
Save diasjorge/1f9238ef54ae0c83a5a6 to your computer and use it in GitHub Desktop.
Interact with riak attach
#!/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