[packages] mysql: properly handle quoted datadirs in initscript

git-svn-id: svn://svn.openwrt.org/openwrt/packages@25243 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
jow 2011-01-29 18:51:47 +00:00
parent 48a5443262
commit b8b0482937

View File

@ -8,7 +8,7 @@ PID=/var/run/mysqld.pid
CMD=/usr/bin/mysqld
start() {
local datadir=$(sed -n -e 's/^[[:space:]]*datadir[[:space:]]*=[[:space:]]*//p' /etc/my.cnf)
local datadir=$(sed -n -e "s/^[[:space:]]*datadir[[:space:]]*=[[:space:]]*[\"']\?\([^\"']*\)[\"']\?/\1/p" /etc/my.cnf)
if [ ! -d "$datadir" ]; then
echo "Error: datadir in /etc/my.cnf ($datadir) doesn't exist"
return 1