mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-22 16:43:35 +00:00
fix: 修复redis密码传参问题
This commit is contained in:
@@ -288,12 +288,12 @@ check_redis() {
|
|||||||
# 测试Redis连接
|
# 测试Redis连接
|
||||||
print_info "测试 Redis 连接..."
|
print_info "测试 Redis 连接..."
|
||||||
if command_exists redis-cli; then
|
if command_exists redis-cli; then
|
||||||
local redis_test_cmd="redis-cli -h $REDIS_HOST -p $REDIS_PORT"
|
local redis_args=(-h "$REDIS_HOST" -p "$REDIS_PORT")
|
||||||
if [ -n "$REDIS_PASSWORD" ]; then
|
if [ -n "$REDIS_PASSWORD" ]; then
|
||||||
redis_test_cmd="$redis_test_cmd -a '$REDIS_PASSWORD'"
|
redis_args+=(-a "$REDIS_PASSWORD")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if $redis_test_cmd ping 2>/dev/null | grep -q "PONG"; then
|
if redis-cli "${redis_args[@]}" ping 2>/dev/null | grep -q "PONG"; then
|
||||||
print_success "Redis 连接成功"
|
print_success "Redis 连接成功"
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
@@ -1754,4 +1754,4 @@ main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# 运行主函数
|
# 运行主函数
|
||||||
main "$@"
|
main "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user