udp_proxy_wrapper.sh: fix cleanup not cleaning up

Fixed cleanup leaving the actual udp_proxy behind and only killing an
intermediate shell process.

Fixed trap handler cleaning up but then not dying.
This commit is contained in:
Gilles Peskine 2017-10-24 12:22:40 +02:00 committed by Hanno Becker
parent afc4f892d1
commit 8149321fed

View file

@ -29,7 +29,7 @@ stop_server() {
cleanup() {
stop_server
stop_proxy
return 1
exit 129
}
trap cleanup INT TERM HUP
@ -96,7 +96,7 @@ echo " * Start proxy in background ..."
if [ $VERBOSE -gt 0 ]; then
echo "[ $tpxy_cmd_snippet ]"
fi
eval "$tpxy_cmd_snippet" >/dev/null 2>&1 &
eval exec "$tpxy_cmd_snippet" >/dev/null 2>&1 &
tpxy_pid=$!
if [ $VERBOSE -gt 0 ]; then
@ -108,7 +108,7 @@ if [ $VERBOSE -gt 0 ]; then
echo "[ $SRV_BIN $* ]"
fi
"$SRV_BIN" "$@" >&2 &
exec "$SRV_BIN" "$@" >&2 &
srv_pid=$!
wait $srv_pid