# sun-panel-replace-ip **Repository Path**: gsw945/sun-panel-replace-ip ## Basic Information - **Project Name**: sun-panel-replace-ip - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-09-10 - **Last Updated**: 2025-09-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # sun-panel-replace-ip replace ip in sun-panel items ## 一、项目搭建记录 ```bash mkdir sun-panel-replace-ip cd sun-panel-replace-ip/ go mod init sun-panel-replace-ip go get -u modernc.org/sqlite touch main.go ``` ### 二、设置Go包源加速和安装Go包 ```bash # 启用 Go Mod set GO111MODULE=on # 使用国内源 set GOPROXY=https://goproxy.cn,direct # 安装Go包 go mod tidy -v ``` ### (三)、Windows 编译 -> Windows 运行 ```bash # 编译 SET GOARCH=amd64 SET GOOS=windows go build -o "sun-panel-replace-ip_%GOOS%_%GOARCH%.exe" "main.go" # 运行 sun-panel-replace-ip_windows_amd64.exe -h # 在 sun-panel.exe 所在目录执行 sun-panel-replace-ip_windows_amd64.exe -db ".\database\database.db" -from 192.168.1.113 -to 192.168.1.95 ``` ### (四)、Windows 编译 -> Linux 运行 ```bash # 编译 SET GOARCH=amd64 SET GOOS=linux go build -o "sun-panel-replace-ip_%GOOS%_%GOARCH%" "main.go" # 运行 chmod a+x ./sun-panel-replace-ip_linux_amd64 ./sun-panel-replace-ip_linux_amd64 -h # 在 sun-panel 可执行文件所在目录执行 ./sun-panel-replace-ip_linux_amd64 -db "./database/database.db" -from 192.168.1.113 -to 192.168.1.95 ```