From 4baa56d0423a8d59f794e10f7e5f65747613265a Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Sat, 5 Mar 2016 21:59:07 +0100 Subject: [PATCH] Wrapper script: Give server ten seconds to wind down properly. --- roguelike | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/roguelike b/roguelike index cad9b70..b997a9f 100755 --- a/roguelike +++ b/roguelike @@ -1,8 +1,16 @@ #!/bin/sh # Wrapper to the script so that its suppressed server messages get read on exit. -# and server_run/ get's deleted in any case. ./start_server_client_union.sh "$@" + +# Give server up to ten seconds to wind down properly. +i=0 +while [ -e ./server_run/in ] && [ $i -le 100 ] +do + echo 'QUIT' >> server_run/in + sleep 0.1 + i=`expr $i + 1` +done rm -rf ./server_run/ # For some reason, mere sync won't ensure a log is written out, so wait a while. -- 2.30.2