Bulk domain add

after the update, my bash script started to add domains with additional charactes which ruins the Hestia. Could you tell me what is changed to fix the script?

#!/bin/bash

# Задай переменные пользователя и IP
USER="test"
IP="sdfsfsdf"

# Путь к файлу с доменами
INPUT_FILE="domains_list.txt"

# Проверка существования файла
if [[ ! -f "$INPUT_FILE" ]]; then
    echo "Файл $INPUT_FILE не найден!"
    exit 1
fi

# Проверка существования пользователя
if ! v-list-user "$USER" &>/dev/null; then
    echo "Ошибка: пользователь $USER не существует!"
    exit 1
fi

# Цикл по строкам файла
while IFS= read -r domain; do
    # Пропускаем пустые строки
    [[ -z "$domain" ]] && continue

    # Создаём веб-домен
    echo "Создаю сайт $domain для пользователя $USER..."
    if ! v-add-web-domain "$USER" "$domain" "$IP"; then
        echo "Ошибка создания сайта $domain!"
      
    fi

    echo "Сайт $domain успешно создан!"
done < "$INPUT_FILE"

echo "Обработка завершена."

I don’t think you’ll get help with your question here. The question is more about the script and not the panel.

What kind of random characters?

seems like it is about panel because it worked all right before

apparently he hides his IP)

domain.com/?.conf
in apache and nginx ? character. but there was no ? in the list of domains , 100%

Just work on the script better.)
Try to remove invisible characters from your domain file. Or check the encoding.

i said in advance that the file was clean . can you read?

Add additional checks to the script for spaces and hidden characters in the file.
If there are no domains, there is nothing to add. This means that you have hidden characters “?” in your file.

i know how to check lines for hidden characters, if that was the issue i wound be writing here

This is not a problem with the panel. I have no further comments on this. Contact the programmer to have your script improved.

Try echo $domain

It is strange that Hestia adds randomly ?conf

I corrected the script and tested it myself. If the file is empty, the panel does not add anything. It is also useful to recode to utf8

The panel problem is excluded. The “?” symbol is not added. The problem is with the script.