Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # vim: set fileencoding=utf-8 :
- import sys
- import os
- def main():
- msg = sys.stdin.read()
- rcpt = sys.argv[1]
- try:
- rcpt = sys.argv[1]
- except:
- print "Invalid arguments! Usage: <recipient>"
- sys.exit(1)
- #use gnokii to send sms
- gnokii = os.system("echo " + msg + " | /usr/bin/sudo /usr/bin/gnokii --config /home/zenoss/gnokiirc --sendsms " + rcpt)
- #log msg to file
- outfile = open ('/usr/local/zenoss/zenoss/log/python-test-log', 'w')
- outfile.write(msg)
- #execute
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement