mysql: fix datadir check in init script
[feed/packages.git] / utils / mysql / files / mysqld.init
index 48e61896ef952e98f2eaad22651d77f12499e0ff..eec96c08545e181fa11d31348019b4a78b7bea98 100644 (file)
@@ -13,7 +13,7 @@ error() {
 }
 
 start() {
-       local datadir=$(sed -n -e "s/^[[:space:]]*datadir[[:space:]]*=[[:space:]]*[\"']\?\([^\"']*\)[\"']\?/\1/p" /etc/my.cnf)
+       local datadir=$(sed -n -e "s/^[[:space:]]*datadir[[:space:]]*=[[:space:]\"']*\([^[:space:]\"']*\)[[:space:]\"']*/\1/p" /etc/my.cnf)
        if [ ! -d "$datadir" ]; then
                error "Error: datadir '$datadir' in /etc/my.cnf doesn't exist"
                return 1