Files
Leantime/.dev/remote-deploy/32_fix_url.sh

18 lines
512 B
Bash

#!/bin/bash
set -e
APP_DIR=/var/www/onebot
echo "=== 修改站点 URL 为内网 IP ==="
sed -i 's|http://119.29.53.45:8081|http://192.168.1.44:8081|g' "$APP_DIR/config/.env"
grep -E "APP_URL|LEAN_APP_URL" "$APP_DIR/config/.env"
echo ""
echo "=== 清缓存 ==="
rm -rf "$APP_DIR/storage/framework/cache/"* 2>/dev/null
rm -f "$APP_DIR/bootstrap/cache/"*.php 2>/dev/null
echo "缓存已清"
echo ""
echo "=== 验证重定向地址 ==="
curl -s -i http://192.168.1.44:8081/ | grep -iE "^HTTP|^Location" | head -3