Tyblog | Building my ideal router for $50

Does anyone have any advice for what to do in case of a power outage? My espressobin was running great until a storm rolled through and killed the power for a few hours. My UPS isn’t large enough to run my network forever and eventually it all came down while I was away at work. I came back to a corrupt sd card and my attempts at fixing it resulted in kernel panics. I’m hoping I can recover my config and set it all back up again. Is there a clever way to shutdown cleanly?