SHARE
TWEET

Untitled

zerooone Mar 9th, 2011 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. !/bin/bash
  2. # source: Jeremy_Z @ forums.gentoo.org http://forums.gentoo.org/viewtopic-t-351806-postdays-0-postorder-asc-start-550.html
  3. #
  4. # This script will report the progress of the last emerge command run.  It
  5. # reports the TOTAL percentage complete - not the percentage of the current
  6. # package.  For example, if there are 110 packages currently being emerged, and
  7. # it is on the 55th package, it will report 50.
  8. #
  9. # Usage:
  10. # .conkyrc:     ${execibar [time] /path/to/script/emerge-progress.sh}
  11. #
  12. # Usage Example
  13. #               ${execibar 30 /home/youruser/scripts/emerge-progress.sh}
  14.  
  15. tail -n 50 /var/log/emerge.log |\
  16. tac |\
  17. grep -v "Starting retry" |\
  18. grep -iE '([0-9]* of [0-9]*)' -o -m 1 |\
  19. sed -e 's/\(.*\) of \(.*\)/\1 \2/' |\
  20. awk '{print 100.0*$1/$2}' |\
  21. cut -d . -f 1
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top