Update vmcreate1.sh

This commit is contained in:
2025-10-26 19:02:44 +00:00
parent 8dc99cac7c
commit 79d748a7a8

View File

@@ -132,12 +132,21 @@ if ! [[ $size -ge 10 && $size -le 500 ]]; then echo "Disk size increment shoud b
# exit 1
# fi
# Если заданы аргументы И файл
if [[ $# -ne 0 && -v "$file" ]]; then
# Coздаём временный файл из проверенных строк
if [[ $# -ne 0 && -v $file ]]; then
echo "Please use EITHER file OR arguments. Use '-h' flag for help"
exit 3
else
if
if [[ -v $file ]]; then
if [[ ! -e "$file" ]];then
echo "File $file does not exist. Aborting."
exit 4
fi
else
file="hosts"
fi
if [[ $# -ne 0 ]]; then
# Проверка файла на соответствие шаблону IPv4 адреса и hostname, создаём временный файл из валидных строк
if [[ $# -eq 0 && -e "$file" ]]; then