fixed regex error, which replace 2 line in template file

pull/6/head
codejuan 2016-08-04 22:13:45 +08:00
parent 33239c1e6f
commit b038355c81
1 changed files with 1 additions and 1 deletions

View File

@ -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