As far as detecting power loss and responding there are several threads on the subject, but they all are based on the assumption that the hub and router/modem are on a UPS.
Edit:
As far as detecting power loss and responding there are several threads on the subject, but they all are based on the assumption that the hub and router/modem are on a UPS.
Edit: