~mbruzek/charms/trusty/redis-master/trunk

« back to all changes in this revision

Viewing changes to hooks/install

  • Committer: Marco Ceppi
  • Date: 2013-02-07 16:46:27 UTC
  • mfrom: (3.1.1 redis-master)
  • Revision ID: marco@ceppi.net-20130207164627-9ilcg669t3t2i23n
Marco Ceppi 2013-02-06 No bind line, Redis will bind to all interfaces. Since bind expects IP

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/bash
2
 
# Here do anything needed to install the service
3
 
# i.e. apt-get install -y foo  or  bzr branch http://myserver/mycode /srv/webroot
4
2
 
5
3
############################################################################################################
6
4
# Set debugging
8
6
 
9
7
set -ux
10
8
 
11
 
 
12
9
############################################################################################################
13
10
# Install the redis-server package
14
11
############################################################################################################
15
12
 
16
13
apt-get install -y redis-server
17
14
 
18
 
 
19
15
############################################################################################################
20
16
# Set some variables
21
17
############################################################################################################
22
18
 
23
19
MY_HOSTNAME=`hostname -f`
24
20
 
25
 
 
26
21
############################################################################################################
27
22
# Modify the redis-server configuration file
28
23
############################################################################################################
29
24
 
30
 
sed -i.bak -e "s/bind 127.0.0.1/bind ${MY_HOSTNAME}/" /etc/redis/redis.conf
31
 
 
 
25
sed -i.bak -e "s/bind 127.0.0.1/#bind 127.0.0.1/" /etc/redis/redis.conf
32
26
 
33
27
############################################################################################################
34
28
# Open the necessary ports