Add routes if there is activity on the pve/qemu sockets

This commit is contained in:
Alarig Le Lay 2019-01-24 16:27:45 +01:00
parent c2294c55d2
commit a5d52c6079
1 changed files with 9 additions and 0 deletions

View File

@ -0,0 +1,9 @@
#!/bin/sh
inotifywait -q -m --format '%f' /run/qemu-server/ | while read -r vm; do
# Only act if the line is not empty
if [ ${vm} ]; then
# The sed transforms 100.pid (or .whatever) to 100
creationRoutesVM $(echo ${vm} | sed -E 's/([0-9]{3})\..*/\1/')
fi
done