Topic says it all. I have a modification of the script that appears to work on my system, and I'll have it up as soon as I figure out how.
Created attachment 44895 [details]
Proposed updated script
In the future, please post patches rather than the entire script.
in portage. thanks.