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