From 43a916d92fb43050addde691d64eb1f4df91f50a Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sat, 24 Jun 2017 09:56:23 +0200 Subject: apply some fedora changes --- redis-shutdown | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'redis-shutdown') diff --git a/redis-shutdown b/redis-shutdown index 57f21af..53b9f09 100644 --- a/redis-shutdown +++ b/redis-shutdown @@ -18,6 +18,7 @@ CONFIG_FILE="/etc/$SERVICE_NAME.conf" HOST=`awk '/^[[:blank:]]*bind/ { print $2 }' $CONFIG_FILE | tail -n1` PORT=`awk '/^[[:blank:]]*port/ { print $2 }' $CONFIG_FILE | tail -n1` PASS=`awk '/^[[:blank:]]*requirepass/ { print $2 }' $CONFIG_FILE | tail -n1` +SOCK=`awk '/^[[:blank:]]*unixsocket\s/ { print $2 }' $CONFIG_FILE | tail -n1` # Just in case, use default host, port HOST=${HOST:-127.0.0.1} @@ -32,4 +33,8 @@ fi [ -z "$PASS" ] || ADDITIONAL_PARAMS="-a $PASS" # shutdown the service properly -$REDIS_CLI -h $HOST -p $PORT $ADDITIONAL_PARAMS shutdown +if [ -e "$SOCK" ] ; then + $REDIS_CLI -s $SOCK $ADDITIONAL_PARAMS shutdown +else + $REDIS_CLI -h $HOST -p $PORT $ADDITIONAL_PARAMS shutdown +fi -- cgit