initial commit copy from RPIShutdown