Replaced HOST and HOSTNAME variable through hostname command to make it more distribution indepentend

This commit is contained in:
Kevin Veen-Birkenbach 2025-04-05 18:28:20 +02:00
parent c31a8fb329
commit d5ba306081
No known key found for this signature in database
GPG Key ID: 44D8F11FD62F878E
2 changed files with 2 additions and 2 deletions

View File

@ -1,2 +1,2 @@
#!/bin/bash
/usr/bin/curl -s -X POST https://api.telegram.org/bot{{ telegram_bot_token }}/sendMessage -d chat_id={{ telegram_chat_id }} -d text="service $1 on $HOST failed"
/usr/bin/curl -s -X POST https://api.telegram.org/bot{{ telegram_bot_token }}/sendMessage -d chat_id={{ telegram_chat_id }} -d text="service $1 on $(hostname) failed"

View File

@ -20,7 +20,7 @@ clear
PRIMARY_IP=$(ip route get 8.8.8.8 2>/dev/null | awk '{print $7}' | head -n1)
# Print welcome message
echo -e "${HEADER_COLOR}Welcome, $USER on ${HOSTNAME_COLOR}$HOSTNAME!${RESET_COLOR}"
echo -e "${HEADER_COLOR}Welcome, $USER on ${HOSTNAME_COLOR}$(hostname)!${RESET_COLOR}"
echo -e "Primary IP Address: ${PRIMARY_IP}"
echo -e "${HEADER_COLOR}Today is $(date +"%A, %d.%m.%Y %T")${RESET_COLOR}"
echo -e "\033[94mPowered by: CyMaIS - Cyber Master Infrastructure Solutions!"