#!/bin/bash if ping -c1 1.1.1.1 2>&1 >/dev/null; then connectivity=trueelse connectivity=falsefiecho "connectivity=$connectivity" if ping -c1 google.fr 2>&1 >/dev/null; then dns=trueelse dns=falsefiecho "dns=$dns" if nmcli device status | grep -E "^wl" | grep -q connected; then wifi=trueelse wifi=falsefiecho "wifi=$wifi"
#!/bin/bash
if ping -c1 1.1.1.1 2>&1 >/dev/null; then
connectivity=true
else
connectivity=false
fi
echo "connectivity=$connectivity"
if ping -c1 google.fr 2>&1 >/dev/null; then
dns=true
dns=false
echo "dns=$dns"
if nmcli device status | grep -E "^wl" | grep -q connected; then
wifi=true
wifi=false
echo "wifi=$wifi"