From 4f8834e3d373a54d7a79e9d5d93a428f0c871cba Mon Sep 17 00:00:00 2001 From: natemaia Date: Fri, 1 Jun 2018 19:19:37 -0700 Subject: [PATCH] Add bash_profile and update configs --- home/.bash_profile | 5 +++++ home/bin/check-network | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 home/.bash_profile diff --git a/home/.bash_profile b/home/.bash_profile new file mode 100644 index 00000000..cfd85452 --- /dev/null +++ b/home/.bash_profile @@ -0,0 +1,5 @@ +# .bash_profile +# sourced by bash when used as a login shell + +# automatically run startx when logging in on tty1 +[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx -- vt1 &>/dev/null diff --git a/home/bin/check-network b/home/bin/check-network index 2f97760a..37a55582 100755 --- a/home/bin/check-network +++ b/home/bin/check-network @@ -1,13 +1,17 @@ #!/usr/bin/env bash +count=0 disconnected="/" disconnected2="\\" wireless_connected="" ethernet_connected="" while true; do - if ping -c1 8.8.8.8 &>/dev/null; then - ID=$(ip link | awk '/state UP/ {print $2}') + if ping -c1 www.google.com &>/dev/null; then + if (( count < 1 )); then + ID="$(ip link | awk '/state UP/ {print $2}')" + ((count++)) + fi if [[ $ID == e* ]]; then echo "$ethernet_connected" ; sleep 20 else