Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- STATUS=`sudo tail -n 15 /var/log/emerge.log |\
- grep -iE "Compiling|Cleaning|AUTOCLEAN|completed|search|terminating|rsync" |\
- cut -d ' ' -f "2-" |\
- grep -Ev 'Finished\.|Cleaning up\.\.\.' |\
- tail -n 1`
- #echo "$STATUS"
- if [ "`echo "$STATUS" | grep -i compiling`" != "" ]; then echo Compiling
- elif [ "`echo "$STATUS" | grep -i cleaning`" != "" ]; then echo Cleaning
- elif [ "`echo "$STATUS" | grep -i autoclean`" != "" ]; then echo Autoclean
- elif [ "`echo "$STATUS" | grep -i sync`" != "" ]; then echo Syncing
- elif [ "`echo "$STATUS" | grep -i search`" != "" ]; then echo Searching
- elif [ "`echo "$STATUS" | grep -i completed`" != "" ]; then echo Completed
- elif [ "`echo "$STATUS" | grep -i terminating`" != "" ]; then echo Completed
- else echo Script Error!
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement