aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Chemeris <Alexander.Chemeris@gmail.com>2018-01-26 15:53:26 +0900
committerAlexander Chemeris <Alexander.Chemeris@gmail.com>2018-01-26 15:53:26 +0900
commit3a27424ff8956e1e1675a5bfa8128a17d365d134 (patch)
tree51a98be2e02a536cf4cfb0e20afc329ab920b097
parent5705837a1be60da17500d86bb72c0a0bdd328ad8 (diff)
pySim-fairwaves-prog: Add an option to play sound on successful write in the batch mode.
-rwxr-xr-xpySim-fairwaves-prog.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/pySim-fairwaves-prog.py b/pySim-fairwaves-prog.py
index b709af9..1f44d35 100755
--- a/pySim-fairwaves-prog.py
+++ b/pySim-fairwaves-prog.py
@@ -24,6 +24,7 @@ import os
import sys
import csv
import random
+import subprocess
from pySim.commands import SimCardCommands
from pySim.utils import h2b, swap_nibbles, rpad, dec_imsi, dec_iccid, derive_milenage_opc
@@ -208,6 +209,9 @@ def parse_options():
help="Process SIM cards in batch mode - don't exit after programming and wait for the next SIM card to be inserted.",
default=False, action="store_true",
)
+ parser.add_option("--sound", dest="sound_file", type='string', metavar="SOUND_FILE",
+ help="Only in the batch mode. Play the given sound file on successful SIM programming",
+ )
parser.add_option("-n", "--name", dest="name",
help="Operator name [default: %default]",
default="Fairwaves",
@@ -270,3 +274,5 @@ if __name__ == '__main__':
sim_keys = program_sim_card(card, sim_db, opts)
write_params_csv(opts.out_db_filename, sim_keys)
+ if opts.sound_file is not None and opts.sound_file != "":
+ subprocess.call(["paplay", opts.sound_file])