-
-
Save xdtianyu/9be47aac3ab530e66f5bd2008a9df90a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TOKEN = 'xx:xx-xx' | |
CHAT_ID = 'xxx' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cmd="$@" | |
C='' | |
for i in "$@"; do | |
case "$i" in | |
*\'*) | |
i=`printf "%s" "$i" | sed "s/'/'\"'\"'/g"` | |
;; | |
*) : ;; | |
esac | |
C="$C '$i'" | |
done | |
eval "$C" | |
/opt/watcher/venv/bin/python /opt/watcher/tel.py "$cmd" completed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
import telegram | |
import config | |
def tel(message): | |
if len(message) > 0: | |
bot = telegram.Bot(config.TOKEN) | |
bot.sendMessage(config.CHAT_ID, message) | |
if __name__ == "__main__": | |
import sys | |
tel(' '.join(str(x) for x in sys.argv[1:])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tel sleep 30