#!/bin/bash # Epic Game Web Service 启动脚本 echo "==========================================" echo "Epic Game Web Service" echo "Starting with cron jobs enabled..." echo "==========================================" # 检查Go环境 if ! command -v go &> /dev/null; then echo "Error: Go is not installed or not in PATH" exit 1 fi # 检查Go版本 GO_VERSION=$(go version | awk '{print $3}' | sed 's/go//') echo "Go version: $GO_VERSION" # 设置环境变量 export GO_ENV=production export GF_GCFG_FILE=manifest/config/config.yaml # 清理旧的构建文件 echo "Cleaning old build files..." rm -f main.exe rm -f main # 构建项目 echo "Building project..." go build -o main.exe . if [ $? -ne 0 ]; then echo "Error: Build failed" exit 1 fi echo "Build successful!" # 启动服务 echo "Starting server on port 8283..." echo "Cron jobs will be started automatically..." echo "Press Ctrl+C to stop the server" echo "==========================================" # 运行服务 ./main.exe