|
|
|
@@ -29,6 +29,7 @@ def sendmessage (message):
|
|
|
|
url = ("%s/api/webhook/%s" % (baseurl, webhook))
|
|
|
|
url = ("%s/api/webhook/%s" % (baseurl, webhook))
|
|
|
|
myreq = {}
|
|
|
|
myreq = {}
|
|
|
|
myreq['message'] = mymessage
|
|
|
|
myreq['message'] = mymessage
|
|
|
|
|
|
|
|
myreq['notify'] = notify
|
|
|
|
|
|
|
|
|
|
|
|
r = requests.post(url, json = { 'message': mymessage, 'tts': args.tts })
|
|
|
|
r = requests.post(url, json = { 'message': mymessage, 'tts': args.tts })
|
|
|
|
if r.status_code == 200:
|
|
|
|
if r.status_code == 200:
|
|
|
|
@@ -40,7 +41,7 @@ def sendmessage (message):
|
|
|
|
ran = True
|
|
|
|
ran = True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__version__ = "1.2.0"
|
|
|
|
__version__ = "1.3.0"
|
|
|
|
versionstring='TellMe v' + __version__
|
|
|
|
versionstring='TellMe v' + __version__
|
|
|
|
|
|
|
|
|
|
|
|
signal.signal(signal.SIGINT, signal_handler)
|
|
|
|
signal.signal(signal.SIGINT, signal_handler)
|
|
|
|
@@ -53,7 +54,8 @@ parser.add_argument("-m", "--message", default="Your process finished", help="Me
|
|
|
|
parser.add_argument('-t', '--tts', default=False, action='store_true', help="Send message to TTS")
|
|
|
|
parser.add_argument('-t', '--tts', default=False, action='store_true', help="Send message to TTS")
|
|
|
|
parser.add_argument('-v', '--version', action='version', version=versionstring)
|
|
|
|
parser.add_argument('-v', '--version', action='version', version=versionstring)
|
|
|
|
parser.add_argument('-p', '--pid', action="store", dest="pid", type=int, default=0)
|
|
|
|
parser.add_argument('-p', '--pid', action="store", dest="pid", type=int, default=0)
|
|
|
|
parser.add_argument('-n', '--interval', action="store", dest="interval", type=int, default=5, help="Set the interval of commands like watch that use it")
|
|
|
|
parser.add_argument('-n', '--notify', action="store", dest="notify", default=None, help="Notify specific id")
|
|
|
|
|
|
|
|
parser.add_argument('-i', '--interval', action="store", dest="interval", type=int, default=5, help="Set the interval of commands like watch that use it")
|
|
|
|
parser.add_argument('-w', '--watch', action="store", dest="watchcommand", help="Run the given command every n or 5 minutes")
|
|
|
|
parser.add_argument('-w', '--watch', action="store", dest="watchcommand", help="Run the given command every n or 5 minutes")
|
|
|
|
parser.add_argument('-c', '--config', default=home +"/.config/tellme/config.json" ,help="Path to config file")
|
|
|
|
parser.add_argument('-c', '--config', default=home +"/.config/tellme/config.json" ,help="Path to config file")
|
|
|
|
parser.add_argument('-P', '--ping', action="store", dest="pinghost", type=str, help="Ping a host until it is up")
|
|
|
|
parser.add_argument('-P', '--ping', action="store", dest="pinghost", type=str, help="Ping a host until it is up")
|
|
|
|
|