Easy program to print signal strength (RF level) returned by phone. It prints a number that you can assign to a variable or check in a conditional, e.g.:
[ $(rf_level) -lt 1 ] && echo "no signal"
Some phones have a range of -1..4 (with -1 meaning "no signal"), others have a range of 0..100 (with 0 meaning "no signal")
If you can send AT commands to your phone you can get this value using AT+CSQ
but not all phones support this command and some take so long to answer to this command that communication times out if used with gnokii (LG U8120 is one that times out, you might succeed if you first send this command using minicom).
This is the same value reported by gnokii --monitor
while xgnokii
translates this value graphically showing 0 to 4 segments.
C source code: