检查 WordPress 是否已安装,通过检测标准数据库表是否存在。
适合在脚本中判断安装状态,不产生输出,仅通过退出码表示结果。
| 参数 | 说明 |
|---|---|
--network |
检查这是否是多站点安装。 |
$ if ! wp core is-installed 2>/dev/null; then
wp core install
fi
$ if wp core is-installed 2>/dev/null; then
wp core verify-checksums
else
echo 'Hey Friend, you are in the wrong spot. Move in to your WordPress directory and try again.'
fi