Commit b038355c authored by codejuan's avatar codejuan

fixed regex error, which replace 2 line in template file

parent 33239c1e
......@@ -29,7 +29,7 @@ while read -ra LINE; do
sed -i -e "s|^bind.*$|bind ${LINE}|" ${CFG}
elif [ "$(/opt/redis/redis-cli -h $LINE info | grep role | sed 's,\r$,,')" = "role:master" ]; then
# TODO: More restrictive regex?
sed -i -e "s|^.*slaveof.*$|slaveof ${LINE} ${PORT}|" ${CFG}
sed -i -e "s|^# slaveof.*$|slaveof ${LINE} ${PORT}|" ${CFG}
fi
done
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment