File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313fi
1414
1515# 等待wordpress完成引导
16- until docker exec $W9_ID wp core is-installed & > /dev/null; do
16+ until docker exec $W9_ID wp core is-installed > /dev/null 2>&1 ; do
1717 echo " wait for WordPress..."
1818 sleep 5
1919done
2020
21- # 设置home
22- if [ " ` docker exec $W9_ID wp option get home | cut -d: -f1` " == " https" ]; then
23- docker exec $W9_ID wp option update home " https://$W9_URL "
24- else
25- docker exec $W9_ID wp option update home " $WORDPRESS_ROOT_URL "
21+ # W9_URL为空时跳过URL更新,避免将站点URL设为无效值
22+ if [ -z " $W9_URL " ]; then
23+ echo " W9_URL is empty, skip URL update"
24+ exit 0
2625fi
2726
28- # 设置siteurl
29- if [ " ` docker exec $W9_ID wp option get siteurl | cut -d: -f1` " == " https" ]; then
30- docker exec $W9_ID wp option update siteurl " https://$W9_URL "
31- else
32- docker exec $W9_ID wp option update siteurl " $WORDPRESS_ROOT_URL "
33- fi
27+ # 设置home和siteurl
28+ docker exec $W9_ID wp option update home " $WORDPRESS_ROOT_URL "
29+ docker exec $W9_ID wp option update siteurl " $WORDPRESS_ROOT_URL "
Original file line number Diff line number Diff line change 1313fi
1414
1515# 等待wordpress完成引导
16- until docker exec $W9_ID -wordpress wp core is-installed & > /dev/null; do
16+ until docker exec $W9_ID -wordpress wp core is-installed > /dev/null 2>&1 ; do
1717 echo " wait for WordPress..."
1818 sleep 5
1919done
2020
21- # 设置home
22- if [ " ` docker exec $W9_ID -wordpress wp option get home | cut -d: -f1` " == " https" ]; then
23- docker exec $W9_ID -wordpress wp option update home " https://$W9_URL "
24- else
25- docker exec $W9_ID -wordpress wp option update home " $WORDPRESS_ROOT_URL "
21+ # W9_URL为空时跳过URL更新,避免将站点URL设为无效值
22+ if [ -z " $W9_URL " ]; then
23+ echo " W9_URL is empty, skip URL update"
24+ exit 0
2625fi
2726
28- # 设置siteurl
29- if [ " ` docker exec $W9_ID -wordpress wp option get siteurl | cut -d: -f1` " == " https" ]; then
30- docker exec $W9_ID -wordpress wp option update siteurl " https://$W9_URL "
31- else
32- docker exec $W9_ID -wordpress wp option update siteurl " $WORDPRESS_ROOT_URL "
33- fi
27+ # 设置home和siteurl
28+ docker exec $W9_ID -wordpress wp option update home " $WORDPRESS_ROOT_URL "
29+ docker exec $W9_ID -wordpress wp option update siteurl " $WORDPRESS_ROOT_URL "
You can’t perform that action at this time.
0 commit comments