add send_sms file (for testing)
This commit is contained in:
parent
cae36c789c
commit
2ddf0a626f
25
send_sms.py
Normal file
25
send_sms.py
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
import logging
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
from pydbus import SystemBus
|
||||||
|
from gi.repository import GLib
|
||||||
|
import sms_functions
|
||||||
|
|
||||||
|
# Setup logging
|
||||||
|
logfile = "/opt/sms/sms.log"
|
||||||
|
FORMAT = '%(asctime)-15s %(message)s'
|
||||||
|
logging.basicConfig(format=FORMAT,filename=logfile,level=10)
|
||||||
|
logger = logging.getLogger('observiumsms')
|
||||||
|
|
||||||
|
if len(sys.argv) < 3:
|
||||||
|
raise Exception('Not enough arguments')
|
||||||
|
|
||||||
|
# Assemble SMS
|
||||||
|
smsstring = sys.argv[1]
|
||||||
|
nums = sys.argv[2:]
|
||||||
|
logger.info("Sending SMS: %s", smsstring)
|
||||||
|
|
||||||
|
# Contact ModemManager, unlock SIM and send SMS to emergency numbers
|
||||||
|
sms_functions.send_sms(nums, smsstring)
|
Loading…
Reference in New Issue
Block a user