benevolent27

StarMadeBlueprintDownloadMonitor-simple

Dec 4th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.00 KB | None | 0 0
  1. #!/bin/bash
  2. # Instructions:  Set your logDir variable here to point to your StarMade install's log folder.  Then run this script and it should tell you when a blueprint download starts and finishes.
  3. logDir="/home/YourUserName/.steam/steam/steamapps/common/StarMade/StarMade/logs/"
  4. echo "Remember to press CTRL + C when done!" ; set -f
  5. while read -r b; do
  6.     if [[ "${b}" == *"REQUESTED EXTRA INFO FOR LOCAL BLUEPRINT"* ]]; then
  7.         shipName=$(echo "${b}" | grep -Po "Ship\[[A-Za-z0-9_ -]*" | sed 's/^Ship\[//g')
  8.         echo "Ship blueprint download started for entity, '${shipName}'."
  9.         then=$(date '+%s')
  10.     elif [[ "${b}" == *"SAVED LOCAL BLUEPRINT"* ]]; then
  11.         now=$(date "+%s")
  12.         shipName=$(echo "${b}" | grep -Po "Ship\[[A-Za-z0-9_ -]*" | sed 's/^Ship\[//g')
  13.         echo "Ship save finished for entity, '${shipName}'!  Save took $((now - then)) seconds!"
  14.         unset now
  15.         unset then
  16.     fi
  17. done < <(tail -n0 -q -F "${logDir}logstarmade.0.log" 2>/dev/null | stdbuf -i0 -o0 grep --line-buffered "\[CLIENT\]\[PLAYER\]\[BLUEPRINT\]")
Add Comment
Please, Sign In to add comment