You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LOCAL_IP=$(ip route get $DNS | grep src| sed 's/.*src \(.*\)$/\1/g' | awk '{print $1}')
PUBLIC_IP=$(curl -s -X GET http://checkip.amazonaws.com)
cpu=$(cat /sys/class/thermal/thermal_zone0/temp)
FREERAM=$(free -mh | grep Mem | awk '{print $4}')
TOTALRAM=$(free -mh | grep Mem | awk '{print $2}')
/usr/bin/ping -c2 $DNS > /dev/null 2>&1
if [ $? -ne 0 ]
then
exit 0
else
/usr/bin/curl -s -X POST $URL \
-d chat_id=$TOKEN_ID \
-d parse_mode=HTML \
-d text="$(printf "$MSG<code>\n\t\t- CPU temp: $((cpu/1000))°\n\t\t- RAM: Free $FREERAM/ Total $TOTALRAM\n\t\t- IP address: $LOCAL_IP\n\t\t- IP public: $PUBLIC_IP</code>")" \