From 7e564db9faacc564610642941fc4a5ea4f5eb9a3 Mon Sep 17 00:00:00 2001 From: Dmitry Badovsky Date: Fri, 24 Oct 2025 13:07:44 +0000 Subject: [PATCH] Update vmcreate1.sh --- vmcreate1.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vmcreate1.sh b/vmcreate1.sh index a4fa291..0c73135 100644 --- a/vmcreate1.sh +++ b/vmcreate1.sh @@ -11,12 +11,13 @@ show_help() echo "In this case Hostname will be inherited from 2 last IP octets. Example for 10.10.35.20: 'vm035020'." make_file (){ - touch hosts.tmp +if [ $# -eq 0 ] then + do touch hosts.tmp for arg in "$@"; do ipcheck "$arg" if [ $? -eq 0 ] then echo -n "$arg " >> ./hosts.tmp - echo $arg | cut -d '.' -f 3,4 | sed 's/\.//' + echo $arg | cut -d '.' -f 3,4 | sed 's/\.//' >> hosts.tmp } ip_check (){