Connected to my pi is an adafruit fona (a cellular phone), and a manhattan usb hub with external power. My pi, as well as the fona, are connected to a 3.7V 1200mAh backup battery. The pi is configured to detect when the AC power supply is disconnected, and shutdown properly. This whole system works perfectly, except for one thing; the USB hub draws power from the pi when it's AC power is cut off (which it would be when the pi's power is cut off) This happens even when the pi is completely off, and this is a serious problem, as it drains the backup battery which is only intended to allow the pi to shutdown properly.
My question is, how can I stop the battery from providing power after the pi shuts down?
I've considered both relays and transitors used as switches to turn the power off (when not running but powered, some of the pi GPIO's output a resting 3.3V, so that could be used in logic even when the pi is off), but both of those require a voltage to turn off the power, and once pi is shutdown and the battery power cut off, there's no voltage to logically turn the battery off. Thus, a bit of an infinite loop problem. Maybe there's a transistor that only allows power through when the base provides voltage? In that case, the pi could turn on and off the battery, but it would be shut off and stay that way when the pi turns off.