mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-15 16:56:56 +08:00
Fix start script
This commit is contained in:
17
start.sh
17
start.sh
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user