Skip to content

Instantly share code, notes, and snippets.

@Dobbie03
Created March 2, 2018 18:28
Show Gist options
  • Save Dobbie03/4c2a66c6d35721f501656a00a0db5260 to your computer and use it in GitHub Desktop.
Save Dobbie03/4c2a66c6d35721f501656a00a0db5260 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
online=$(ip addr | grep "state UP" | cut -d ":" -f2)
#connected=""
#offline=""
connected=""
offline=""
if [[ "$online" ]]; then
echo " %{F#23EFDC}${connected} "
else
echo " %{F#23EFDC}${offline} "; sleep 1; echo " %{F#FDEE7B}${offline} "
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment