Rewrote the background script to use /proc files instead of shell calls