15 lines
461 B
Bash
Executable File
15 lines
461 B
Bash
Executable File
#!/bin/sh
|
|
apt update > /tmp/os-update
|
|
NEWAPP=`cat /tmp/os-update | grep "frissíthető" | awk '{print $1}'`
|
|
SERVER=`hostname -f`
|
|
|
|
if [ ! -z $NEWAPP ]; then
|
|
chat_id=1940077537
|
|
IP=` curl http://dynip.hu/ip`
|
|
message="$IP : $NEWAPP frissítés elérhető"
|
|
# Telegram message
|
|
curl --location --request GET 'https://api.telegram.org/bot6389646999:AAEKEeVuYgwb9IqD6JUc4n-s3A7Q1EsXwA0/sendMessage' \
|
|
--data "chat_id=$chat_id&text=$message"
|
|
echo "Üzenet elküldve!"
|
|
|
|
fi |