BASH_SRV Telegram 70
🎯 Проверка доступности списка хостов с цветным 🎨 выводом

Иногда нужно быстро проверить, какие сервера "живые", а какие — нет. Ниже написал удобный Bash-скрипт с цветным выводом в терминале 🖥️.


#!/bin/bash

# Список хостов
hosts=("192.168.0.1" "google.com" "yandex.ru" "192.168.0.100")

# Цвета
GREEN="\e[32m"
RED="\e[31m"
NC="\e[0m" # No Color

for host in "${hosts[@]}"; do
if ping -c 1 -W 1 "$host" &> /dev/null; then
echo -e "${GREEN}[UP] $host${NC}"
else
echo -e "${RED}[DOWN] $host${NC}"
fi
done


🔧 Просто добавь нужные IP или домены в массив hosts, и запусти. Удобно и наглядно!

👉@bash_srv
👍9👎1



tgoop.com/bash_srv/70
Create:
Last Update:

🎯 Проверка доступности списка хостов с цветным 🎨 выводом

Иногда нужно быстро проверить, какие сервера "живые", а какие — нет. Ниже написал удобный Bash-скрипт с цветным выводом в терминале 🖥️.


#!/bin/bash

# Список хостов
hosts=("192.168.0.1" "google.com" "yandex.ru" "192.168.0.100")

# Цвета
GREEN="\e[32m"
RED="\e[31m"
NC="\e[0m" # No Color

for host in "${hosts[@]}"; do
if ping -c 1 -W 1 "$host" &> /dev/null; then
echo -e "${GREEN}[UP] $host${NC}"
else
echo -e "${RED}[DOWN] $host${NC}"
fi
done


🔧 Просто добавь нужные IP или домены в массив hosts, и запусти. Удобно и наглядно!

👉@bash_srv

BY Bash Советы




Share with your friend now:
tgoop.com/bash_srv/70

View MORE
Open in Telegram


Telegram News

Date: |

6How to manage your Telegram channel? Telegram offers a powerful toolset that allows businesses to create and manage channels, groups, and bots to broadcast messages, engage in conversations, and offer reliable customer support via bots. To edit your name or bio, click the Menu icon and select “Manage Channel.” Image: Telegram. The court said the defendant had also incited people to commit public nuisance, with messages calling on them to take part in rallies and demonstrations including at Hong Kong International Airport, to block roads and to paralyse the public transportation system. Various forms of protest promoted on the messaging platform included general strikes, lunchtime protests and silent sit-ins.
from us


Telegram Bash Советы
FROM American