diff options
| author | jerome <jerome@xlinfo.fr> | 2022-09-23 11:44:52 +0200 |
|---|---|---|
| committer | jerome <jerome@xlinfo.fr> | 2022-09-23 11:44:52 +0200 |
| commit | c198d2f96c3a2dba1062c9f3225c294305378095 (patch) | |
| tree | aaa5a3ffd674c8d174bd188290d7be19fe194906 | |
| parent | ba5dc12b5b40ef4e76f51ee00fd619c1bedabc9c (diff) | |
| download | vbox-c198d2f96c3a2dba1062c9f3225c294305378095.tar.gz vbox-c198d2f96c3a2dba1062c9f3225c294305378095.zip | |
mise à jour
| -rwxr-xr-x | createvm | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -1,5 +1,8 @@ #!/bin/bash +# on nettoie +rm vms.txt + # Premier numero de la série index=3 # Nombre de machines @@ -28,10 +31,6 @@ for ((i=$index;i<$((index+count));i++));do vboxmanage guestcontrol $vm --username vagrant --password vagrant copyto id_rsa.pub /home/vagrant/.ssh/authorized_keys vboxmanage guestcontrol $vm --username vagrant --password vagrant copyto network_config /home/vagrant/ vboxmanage guestcontrol $vm --username vagrant --password vagrant run /usr/bin/bash /home/vagrant/network_config $vm $ip_addr - if grep -qsw $vm vms.txt; then - sed -i "s/$vm:.*/$vm:$ip_addr/" vms.txt - else - echo "$vm:$ip_addr" >> vms.txt - fi + echo "$vm:$ip_addr" >> vms.txt done echo |
