notification/templates/sendtelegram-login.sh
2023-02-18 09:22:41 +03:00

10 lines
320 B
Bash

#! /bin/sh
APIURL="$(cat /usr/local/bin/sendtelegram.config | grep "APIURL=" | cut -d= -f2)"
CHATID="$(cat /usr/local/bin/sendtelegram.config | grep "CHATID=" | cut -d= -f2)"
TXTMSG="[Authorization] $(cat /etc/hostname):
$(w -h)"
(
curl -s -X POST $APIURL -d chat_id=$CHATID -d text="$TXTMSG" >> /dev/null 2>&1 &
)