Most devices control this via a chip in the battery pack it's self, via SMBus.. The chip reports the battery's capacity and charge level, every few seconds.
If the battery that you are using only has 2 connectors, without some dev work, your out of luck. Some batteries have a serial port (usually a single data pin) that you can connect to an unused uart header, and scrape the needed info from..
However, if you are handy with PIC Microchips, and have one with an analog comparator, you could effectively build your own UART-based battery controller chip.
Batteries provide lower and lower voltage as their charge depletes. You just have to check the current voltage level every so often, and react accordingly. Unfortunately, no pocket routers that I am aware of do this; you will either have to use a laptop battery that already has the appropriate circuitry, or develop one yourself.
Personally, I had to tackle this one myself, using a solar panel, and a 6v powerwheels battery, to power a few of my long-range links.. I ended up writing my own charge controller on a PIC18F
V/r,
Conjur