summaryrefslogtreecommitdiffstats
path: root/redis-shutdown
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2015-04-14 16:44:14 +0200
committerRemi Collet <fedora@famillecollet.com>2015-04-14 16:44:14 +0200
commit272bc5cc46ddd19aef1f56aa42b188330884e8df (patch)
treebff43e84525a48e0338cea0f3307bdb70f7fe282 /redis-shutdown
parent867d82d395d3049f4626610ed63b22c64af793da (diff)
redis: pull rawhide changes
Diffstat (limited to 'redis-shutdown')
-rw-r--r--redis-shutdown8
1 files changed, 5 insertions, 3 deletions
diff --git a/redis-shutdown b/redis-shutdown
index 1b0622f..e03d9a6 100644
--- a/redis-shutdown
+++ b/redis-shutdown
@@ -14,10 +14,12 @@ fi
# Get the proper config file based on service name
CONFIG_FILE="/etc/$SERVICE_NAME.conf"
-# Use awk to retrieve port from config file
+# Use awk to retrieve host, port from config file
+HOST=`awk '/^[[:blank:]]*bind/ { print $2 }' $CONFIG_FILE`
PORT=`awk '/^[[:blank:]]*port/ { print $2 }' $CONFIG_FILE`
-# Just in case, use default port
+# Just in case, use default host, port
+HOST=${HOST:-127.0.0.1}
if [ "$SERVICE_NAME" = redis ]; then
PORT=${PORT:-6379}
else
@@ -25,4 +27,4 @@ else
fi
# shutdown the service properly
-$REDIS_CLI -p $PORT shutdown \ No newline at end of file
+$REDIS_CLI -h $HOST -p $PORT shutdown