From 7da50762387d67d437dc219f75f252a4de5ce95c Mon Sep 17 00:00:00 2001 From: Dmitry Badovsky Date: Fri, 24 Oct 2025 13:02:12 +0000 Subject: [PATCH] Update vmcreate1.sh --- vmcreate1.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vmcreate1.sh b/vmcreate1.sh index 49adb10..a4fa291 100644 --- a/vmcreate1.sh +++ b/vmcreate1.sh @@ -12,6 +12,11 @@ show_help() make_file (){ 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/\.//' } ip_check (){ @@ -47,7 +52,7 @@ cat $file | while read line do ip=$(echo $line | cut -d ' ' -f 1) hostname=$(echo $line | cut -d ' ' -f 2) - vmnum=$(echo $ip | cut -d '.' -f 3)(echo $ip | cut -d '.' -f 3) + vmnum=$(echo $ip | cut -d '.' -f 3,4 | sed 's/\.//') qm clone 5000 $vmnum --name $hostname --full if [ $? -eq 0 ] then echo "clone OK"