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 (){