Created
August 12, 2013 03:52
-
-
Save lephuongbg/6208142 to your computer and use it in GitHub Desktop.
Send USSD Topup Query
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
modem=`ussdIdent` | |
if [ "x" = "x$1" ] | |
then | |
echo Need to give me a top up code! | |
exit -1 | |
fi | |
qry="*100*$1#" | |
echo "Sending $qry to $modem ..." | |
resp=`dbus-send --system --print-reply --dest=org.freedesktop.ModemManager $modem org.freedesktop.ModemManager.Modem.Gsm.Ussd.Initiate string:$qry` | |
resp=`echo $resp | sed 's/.* string "//' | sed 's/"//'` | |
echo $resp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment