diff --git a/capsulflask/shell_scripts/capacity-avaliable.sh b/capsulflask/shell_scripts/capacity-avaliable.sh index d4b94f7..f661283 100755 --- a/capsulflask/shell_scripts/capacity-avaliable.sh +++ b/capsulflask/shell_scripts/capacity-avaliable.sh @@ -20,8 +20,8 @@ if [ "$ram_bytes_remainder" -le $((20 * 1024 * 1024 * 1024)) ]; then fi ipv4_limit=28 -used_ips=$(grep ip-add "/var/lib/libvirt/dnsmasq/virbr1.status" | cut -d '"' -f 4) -reserved_ips=$(cat "/var/lib/libvirt/dnsmasq/public1.hostsfile" | cut -d ',' -f 2) +used_ips=$(grep ip-add "/var/lib/libvirt/dnsmasq/virbr2.status" | cut -d '"' -f 4) +reserved_ips=$(cat "/var/lib/libvirt/dnsmasq/public2.hostsfile" | cut -d ',' -f 2) total_addresses_used=$(printf "$used_ips\n$reserved_ips" | sort | uniq | wc -l) ipv4_count=$(printf "$total_addresses_used") diff --git a/capsulflask/shell_scripts/create.sh b/capsulflask/shell_scripts/create.sh index 264050b..27a112f 100755 --- a/capsulflask/shell_scripts/create.sh +++ b/capsulflask/shell_scripts/create.sh @@ -16,23 +16,23 @@ if echo "$vmname" | grep -vqE '^capsul-[a-z0-9]{10}$'; then exit 1 fi -if [ ! -f "$template_file" ]; then +if [ ! -f "$template_file" ]; then echo "template $template_file not found" exit 1 fi -if echo "$vcpus" | grep -vqE "^[0-9]+$"; then +if echo "$vcpus" | grep -vqE "^[0-9]+$"; then echo "vcpus \"$vcpus\" must be an integer" exit 1 fi -if echo "$memory" | grep -vqE "^[0-9]+$"; then +if echo "$memory" | grep -vqE "^[0-9]+$"; then echo "memory \"$memory\" must be an integer" exit 1 fi echo "$pubkeys" | while IFS= read -r line; do - if echo "$line" | grep -vqE '^(ssh|ecdsa)-[0-9A-Za-z+/_=@:. -]+$'; then + if echo "$line" | grep -vqE '^(ssh|ecdsa)-[0-9A-Za-z+/_=@:. -]+$'; then echo "pubkey \"$line\" must match \"^(ssh|ecdsa)-[0-9A-Za-z+/_=@:. -]+$\"" exit 1 fi @@ -66,7 +66,7 @@ virt-install \ --os-variant generic \ --virt-type kvm \ --graphics vnc,listen=127.0.0.1 \ - --network network=public1,filterref=clean-traffic,model=virtio \ + --network network=public2,filterref=clean-traffic,model=virtio \ --import \ --print-xml > "$xml"