Skip to content

Commit 2864bc6

Browse files
samarahupritha-srivastava
authored andcommitted
vstart: Add flushall call if redis server found
Signed-off-by: Pritha Srivastava <[email protected]> Signed-off-by: Samarah <[email protected]>
1 parent 4a1b8fe commit 2864bc6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/vstart.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55
# abort on failure
66
set -e
77

8+
# flush local redis server
9+
pid=`ps -ef | grep "redis-server" | grep -v grep | awk -F' ' '{print $2}'`
10+
if [[ -n $pid ]]; then
11+
echo "Flushing redis-server."
12+
redis-cli FLUSHALL
13+
fi
14+
815
quoted_print() {
916
for s in "$@"; do
1017
if [[ "$s" =~ \ ]]; then

0 commit comments

Comments
 (0)