From 7a00563174f8a276603be7f6021ca07e710657d7 Mon Sep 17 00:00:00 2001 From: Dmitry Badovsky Date: Sun, 26 Oct 2025 15:33:07 +0000 Subject: [PATCH] Update vmcreate1.sh --- vmcreate1.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vmcreate1.sh b/vmcreate1.sh index 9e9b97c..c15d2ac 100644 --- a/vmcreate1.sh +++ b/vmcreate1.sh @@ -148,10 +148,11 @@ if [[ $# -ne 0 && -v "$file" ]]; then fi # Проверка файла на соответствие шаблону IPv4 адреса и hostname, создаём временный файл из валидных строк -if [[ -e "$file" ]]; then +if [[ $# -eq 0 && -e "$file" ]]; then touch hosts.tmp echo -n "" > hosts.tmp for line in $(cat "$file"); do + echo "DEBUG line:$line" ip=$(echo $line | cut -d ' ' -f 1) hostname=$(echo $line | cut -d ' ' -f 2) if [[ $? -eq 0 ]]; then