Fix start script

This commit is contained in:
icy
2025-10-31 12:46:16 +08:00
parent 7ce0e5d0cb
commit a8e3673e3c

View File

@@ -78,17 +78,14 @@ check_env() {
} }
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------
# Validation: Configuration File (config.json) # Validation: Database File (trading.db)
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------
check_config() { check_database() {
if [ ! -f "config.json" ]; then if [ ! -f "trading.db" ]; then
print_warning "config.json 不存在,从模板复制..." print_info "数据库文件不存在,系统将在启动时自动创建"
cp config.json.example config.json else
print_info "请编辑 config.json 填入你的 API 密钥" print_success "数据库文件存在"
print_info "运行: nano config.json 或使用其他编辑器"
exit 1
fi fi
print_success "配置文件存在"
} }
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------
@@ -246,7 +243,7 @@ main() {
case "${1:-start}" in case "${1:-start}" in
start) start)
check_env check_env
check_config check_database
start "$2" start "$2"
;; ;;
stop) stop)