Michal Nasiadka 426744a271 openvswitch: Add ovs_wrapper for handling TERM
Partial-Bug: #2048130
Change-Id: I81eba2644eda6edd38c541f798bead04c2fa6578
2024-03-23 15:10:16 +00:00

20 lines
275 B
Bash

#!/usr/bin/env bash
catch_term() {
ovs-appctl -T1 -t /run/openvswitch/$1.$child.ctl exit
exit 0
}
catch_quit() {
ovs-appctl -T1 -t /run/openvswitch/$1.$child.ctl exit
exit 0
}
trap catch_term SIGTERM
trap catch_quit SIGQUIT
"$@" &
child=$!
wait "$child"