You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
359 B

3 years ago
  1. #!/bin/bash
  2. if ping -c1 1.1.1.1 2>&1 >/dev/null; then
  3. connectivity=true
  4. else
  5. connectivity=false
  6. fi
  7. echo "connectivity=$connectivity"
  8. if ping -c1 google.fr 2>&1 >/dev/null; then
  9. dns=true
  10. else
  11. dns=false
  12. fi
  13. echo "dns=$dns"
  14. if nmcli device status | grep -E "^wl" | grep -q connected; then
  15. wifi=true
  16. else
  17. wifi=false
  18. fi
  19. echo "wifi=$wifi"