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

  1. #!/bin/bash
  2. COMMAND=${@};
  3. CONTAINER=mindustry_server;
  4. DATE=`date -Iseconds`;
  5. echo "$COMMAND" | docker attach $CONTAINER &
  6. PID=$$
  7. # reasonably speaking, logs dont happen til action is done
  8. while [ "$LOGS" == "" ]; do
  9. LOGS=$(docker logs --since "$DATE" $CONTAINER)
  10. done
  11. # sleep just in case stuff is still going on
  12. sleep 1
  13. echo "$LOGS"
  14. {kill $PID} 2>/dev/null