Update vmcreate1.sh
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user