Skip to content

Instantly share code, notes, and snippets.

View bugra-derre's full-sized avatar

Bugra bugra-derre

View GitHub Profile
#!/bin/bash -ex
# Stop the Riak node
service riak stop
# Change standard IP to the Riak node's eth0 IP
my_ip=`ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'`
sed -ire "s/[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\"\, 8087/$my_ip\"\, 8087/g" /etc/riak/app.config
sed -ire "s/[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\"\, 8098/$my_ip\"\, 8098/g" /etc/riak/app.config
sed -ire "s/\-name riak\@[0-9]*(\.[0-9]*){3}/\-name riak\@$my_ip/" /etc/riak/vm.args