- modifications for USB Eject code

- add functions to detect shutdown and others