fix stop vm

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2025-05-11 23:42:36 +02:00
commit b108d836ff
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
2 changed files with 2 additions and 3 deletions

View file

@ -74,8 +74,7 @@ function qemu_stop_vm {
local unix_path="/tmp/${vm_name}.qmp-sock"
print_in_color "${COLOR_RED}" "Stop ${vm_name}"
echo '{ "execute": "qmp_capabilities" }' | socat - UNIX-CONNECT:"${unix_path}"
echo '{ "execute": "system_powerdown" }' | socat - UNIX-CONNECT:"${unix_path}"
echo -e '{ "execute": "qmp_capabilities" }\n{ "execute": "system_powerdown" }' | socat - UNIX-CONNECT:"${unix_path}" > /dev/null
print_in_color "${COLOR_RED}" "Delete tap${tap_id}"

View file

@ -103,7 +103,7 @@ function delete_subnet {
delete_in_db "subnet" "${subnet_name}"
ip -n "${vpc_name}" route del "${subnet}" dev "br-${subnet_id}"
ip link del dev "vxlan-${vxlan_id}"
systemctl stop "dnsmasq@${vpc_name_br}-br-${subnet_id}.service"
systemctl stop "dnsmasq@${vpc_name}_br-${subnet_id}.service"
rm /etc/dnsmasq.d/${vpc_name}_br-${subnet_id}.conf
ebtables -D FORWARD -p arp --arp-op Request --arp-ip-dst "${gateway_ip}" --out-interface "br-${subnet_id}" -j DROP
ebtables -D FORWARD --out-interface "br-${subnet_id}" -p IPv4 --ip-protocol udp --ip-source-port 67:68 --ip-destination-port 67:68 -j DROP