Just log in with your secure internet shell to change this file!

me: yea.. added a few words already..
me update: actually..its quite a lot now..do you like it?

You may want to read: How to ~tilde: Getting Started for help.

me: ok..sure

Check out your new blog!

me: nice.. thank you..

04:57:35 up 303 days, 9:51, 457 users, load average: 4.25, 3.69, 3.02

Name:

Message:

Do you want to delete this note?



Date: July 24, 2024 - 08:18 AM - 175.139.235.17
xev wrote:

#!/bin/bash

# Define the device names and IP addresses
declare -A devices=(
["lektrik"]="192.168.1.8"
["kuya"]="192.168.1.21"
["maksukul"]="192.168.1.22"
["tarai"]="192.168.1.50"
["nikalila"]="192.168.1.98"
["bacuba"]="192.168.1.101"
["inilagi"]="192.168.1.3"
)

# Function to check the connection status of a device
check_connection() {
local device_name=$1
local device_ip="${devices[$device_name]}"
if ping -c 1 -W 1 "$device_ip" &> /dev/null; then
echo "$device_name ($device_ip) is connected"
else
echo "$device_name ($device_ip) is disconnected"
fi
}

# Continuously monitor the connection status
while true; do
for device_name in "${!devices[@]}"; do
check_connection "$device_name"
done
sleep 1 # Wait for 1 second before checking again
done




Password: