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.

4 jaren geleden
123456789101112131415161718192021
  1. #!/usr/bin/env sh
  2. #
  3. # pbrisbin 2014 - on screen network info.
  4. #
  5. ###
  6. essid="$(iwconfig 2>/dev/null | sed '/^.*ESSID:"\(.*\)".*$/!d; s//\1/')"
  7. if [ -n "$essid" ]; then
  8. if ping -c 1 google.com >/dev/null; then
  9. icon='connect_established'
  10. message="connected to $essid"
  11. else
  12. icon='connect_no'
  13. message="connected to $essid, no internet"
  14. fi
  15. else
  16. icon='connect_no'
  17. message="network not connected"
  18. fi
  19. notify-send -i "$icon" 'Network' "$message"