Browse Source

完善资源删除脚本

chenlei1231 3 months ago
parent
commit
c921c0bef3
1 changed files with 9 additions and 1 deletions
  1. 9 1
      remove-and-bak-wpsite.sh

+ 9 - 1
remove-and-bak-wpsite.sh

@@ -62,7 +62,6 @@ if [ -d "$DIR_TO_CHECK" ]; then
     echo "Failed to delete database $SITE_CODE."
   fi
 
-
   # 删除nginx 配置文件 #
   sudo rm -f /usr/local/openresty/nginx/vhost/$SITE_CODE.conf
 
@@ -75,6 +74,15 @@ if [ -d "$DIR_TO_CHECK" ]; then
   echo "reload nginx config done!"
 
 else
+
+  # 删除nginx 配置文件 #
+  sudo rm -f /usr/local/openresty/nginx/vhost/$SITE_CODE.conf
+  # 删除nginx 站点日志文件 #
+  sudo rm -f /usr/local/openresty/nginx/logs/$SITE_CODE.error.log
+  sudo rm -f /usr/local/openresty/nginx/logs/$SITE_CODE.access.log
+
+  echo "remove nginx $SITE_CODE config and log file"
+
   # 目录不存在,输出指定内容
   echo "The specified directory does not exist."
 fi