You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

18 lines
369 B

#!/bin/bash
COMMAND=${@};
CONTAINER=mindustry_server;
DATE=`date -Iseconds`;
echo "$COMMAND" | docker attach $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 $PID} 2>/dev/null