diff --git a/main.py b/main.py index e1b315b..9cb9779 100755 --- a/main.py +++ b/main.py @@ -5,6 +5,7 @@ from logging.handlers import TimedRotatingFileHandler import ConfigParser import json from os import getpid +import os import re import signal import sys @@ -708,6 +709,20 @@ def updateChipInfo(msisdn): CHIPINFO = BASE_CHIPINFO + '-' + msisdn logger.info('CHIPINFO: {0}'.format(CHIPINFO)) + +def removeOverLimitProducts(): + global PRODUCTS + + if os.path.isfile('XL5.deny'): + sate24.removeProduct(PRODUCTS, 'XL5') + + if os.path.isfile('XL10.deny'): + sate24.removeProduct(PRODUCTS, 'XL10') + + if os.path.isfile('ALL.deny'): + sate24.removeProduct(PRODUCTS, 'XL5') + sate24.removeProduct(PRODUCTS, 'XL10') + def main(): global logger @@ -775,6 +790,8 @@ def main(): checkAccount(modem) sleep(5) + removeOverLimitProducts() + enablePull() checkBalance(modem)