Browse Source

wait for logs to appear and then sleep for a second, *better measure on deciding if command is done* then kill it

pull/1/head
thehuntedpie 7 years ago
parent
commit
6e86a37031
  1. 16
      console.sh

16
console.sh

@ -1,8 +1,18 @@
#!/bin/bash -x
#!/bin/bash
COMMAND=${@};
CONTAINER=mindustry_server;
DATE=`date -Iseconds`;
echo "$COMMAND" | docker attach $CONTAINER &
sleep 1;
docker logs --since "$DATE" $CONTAINER
PID=$$
# reasonably speaking, logs dont happen til action is done
while [ "$LOGS" == "" ]; do
LOGS=$(docker logs --since "$DATE" $CONTAINER)
done
# sleep just in case stuff is still going on
sleep 1
echo "$LOGS"
kill -9 $PID
Loading…
Cancel
Save