#!/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 else dns=false fi echo "dns=$dns" if nmcli device status | grep -E "^wl" | grep -q connected; then wifi=true else wifi=false fi echo "wifi=$wifi"