Skip to content

Instantly share code, notes, and snippets.

@MaZderMind
Created June 5, 2014 16:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MaZderMind/355bb4f099ce40abcd8e to your computer and use it in GitHub Desktop.
Save MaZderMind/355bb4f099ce40abcd8e to your computer and use it in GitHub Desktop.
Aktuelles Guthaben via Shell von einem angeschlossenen Prepaid-USB-3G-Stick auslesen. Getestet mit Congstar Prepaid-Stick.
#!/bin/sh
export LANG=C
echo "wait 60 seconds"
{
gammu getussd "*100#" |\
grep reply |\
awk '{print substr($4, 2, length($4)-2)}' |\
sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' |\
xargs printf;
} &
sleep 60
kill -term $$
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment