compat.sh: never kill our server

This commit is contained in:
Manuel Pégourié-Gonnard 2014-02-27 11:50:40 +01:00
parent 87ae3031ac
commit 911622d84a

View File

@ -74,8 +74,8 @@ filter()
NEW_LIST="$NEW_LIST $( echo "$i" | grep "$FILTER" )" NEW_LIST="$NEW_LIST $( echo "$i" | grep "$FILTER" )"
done done
# make sure the list is actually empty if it contains only whitespace # normalize whitespace
echo "$NEW_LIST" | sed -e 's/^[[:space:]]*//' echo "$NEW_LIST" | sed -e 's/[[:space:]]\+/ /g' -e 's/^ //' -e 's/ $//'
} }
setup_ciphersuites() setup_ciphersuites()
@ -463,16 +463,20 @@ start_server() {
sleep 1 sleep 1
} }
# terminate the running server (try closing it cleanly if possible) # terminate the running server (closing it cleanly if it is ours)
stop_server() { stop_server() {
case $SERVER_NAME in case $SERVER_NAME in
[Pp]olar*) [Pp]olar*)
echo SERVERQUIT | $OPENSSL s_client $O_CLIENT_ARGS >/dev/null 2>&1 # we must force a PSK suite when in PSK mode (otherwise client
sleep 1 # auth will fail), so use $O_CIPHERS
CS=$( echo "$O_CIPHERS" | tr ' ' ':' )
echo SERVERQUIT | \
$OPENSSL s_client $O_CLIENT_ARGS -cipher "$CS" >/dev/null 2>&1
;; ;;
*)
kill $PROCESS_ID 2>/dev/null
esac esac
kill $PROCESS_ID 2>/dev/null
wait $PROCESS_ID 2>/dev/null wait $PROCESS_ID 2>/dev/null
rm -f srv_out rm -f srv_out
} }