Add sendmail scripts
This commit is contained in:
parent
d851805534
commit
39ed323d3b
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/sh
|
||||||
|
tee -a /home/server/mail.log | /usr/sbin/sendmailtelegram
|
|
@ -0,0 +1,18 @@
|
||||||
|
#!/usr/bin/python3
|
||||||
|
import telegram
|
||||||
|
import fileinput
|
||||||
|
import asyncio
|
||||||
|
|
||||||
|
async def run():
|
||||||
|
text = "Vault Etienne:\n\n"
|
||||||
|
for line in fileinput.input():
|
||||||
|
text += line
|
||||||
|
|
||||||
|
bot = telegram.Bot(token="381718873:AAElFmI2BDjumCehhWicuksE0vutrPSkoGA")
|
||||||
|
chat_id = 125754925
|
||||||
|
await bot.send_message(chat_id, text)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
loop = asyncio.get_event_loop()
|
||||||
|
loop.run_until_complete(asyncio.wait([loop.create_task(run())]))
|
||||||
|
loop.close()
|
Loading…
Reference in New Issue