« Bash : Script Ping » : différence entre les versions

De www.yakakliker.org
Aucun résumé des modifications
Aucun résumé des modifications
 
Ligne 28 : Ligne 28 :
   });
   });
</script>
</script>
‎</html>
‎<html>
<a href="https://www.compteurdevisite.com" title="compteur web gratuit sans pub"><img src="https://counter6.optistats.ovh/private/compteurdevisite.php?c=b4epghealnwlf7wuq7gn3ygll9aywrfx" border="0" title="compteur web gratuit sans pub" alt="compteur web gratuit sans pub"></a>
‎</html>
‎</html>

Dernière version du 17 février 2025 à 17:45

#!/bin/bash
 
IP="8.8.8.8" # Replace with the IP address you want to ping
COUNT=1 # Number of ping attempts
 
if ping -c $COUNT $IP > /dev/null 2>&1; then
  echo "Ping to $IP was successful."
else
  echo "Ping to $IP failed."
fi

Liens

https://tecadmin.net/check-network-connectivity-using-ping-in-shell-scripts/

compteur web gratuit sans pub