Advertisement
edps

emerge-status.sh

Nov 9th, 2015
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.77 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. STATUS=`sudo tail -n 15 /var/log/emerge.log |\
  4. grep -iE "Compiling|Cleaning|AUTOCLEAN|completed|search|terminating|rsync" |\
  5. cut -d ' ' -f "2-" |\
  6. grep -Ev 'Finished\.|Cleaning up\.\.\.' |\
  7. tail -n 1`
  8.  
  9. #echo "$STATUS"
  10.  
  11. if [ "`echo "$STATUS" | grep -i compiling`" != "" ]; then echo Compiling
  12. elif [ "`echo "$STATUS" | grep -i cleaning`" != "" ]; then echo Cleaning
  13. elif [ "`echo "$STATUS" | grep -i autoclean`" != "" ]; then echo Autoclean
  14. elif [ "`echo "$STATUS" | grep -i sync`" != "" ]; then echo Syncing
  15. elif [ "`echo "$STATUS" | grep -i search`" != "" ]; then echo Searching
  16. elif [ "`echo "$STATUS" | grep -i completed`" != "" ]; then echo Completed
  17. elif [ "`echo "$STATUS" | grep -i terminating`" != "" ]; then echo Completed
  18. else echo Script Error!
  19. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement