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 "Обработка завершена."
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.