Add routes and make ARP/NDP permanent when a VM is moved to a proxmox node
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

13 lines
583 B

#!/bin/sh
inotifywait -q -m --format '%f' -e create /run/qemu-server/ | while read -r vm; do
# Only act if the line is not empty
if [ ${vm} ] && [ "$(echo ${vm} | sed -E 's/[0-9]{3}(\..*)/\1/')" = ".qmp" ]; then
# Get VM id ; The sed transforms 100.pid (or .whatever) to 100
vm_id=$(echo ${vm} | sed -E 's/([0-9]{3})\..*/\1/')
# If vm status is not "stopped"
if [ "$(qm status ${vm_id})" != "status: stopped" ]; then
creationRoutesVM ${vm_id}
fi
fi
done