Skip to content

Instantly share code, notes, and snippets.

@hongkongkiwi
Last active January 9, 2017 08:31
Show Gist options
  • Save hongkongkiwi/8528c62facb9f560b287 to your computer and use it in GitHub Desktop.
Save hongkongkiwi/8528c62facb9f560b287 to your computer and use it in GitHub Desktop.
Update Redis Config file with Private IP Address
#!/bin/bash
IP_ADDRESS=`ifconfig eth1 | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'`
sed -i "s/bind 127.0.0.1/bind ${IP_ADDRESS} 127.0.0.1/g" /etc/redis/redis.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment