From e8390f0eaec8ab94b9af3d3851a95fddb42209e0 Mon Sep 17 00:00:00 2001 From: ViktorBarzin Date: Fri, 15 Dec 2017 00:00:01 +0000 Subject: [PATCH] Adding new stuff --- .bash_aliases | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.bash_aliases b/.bash_aliases index 9c86160..57f920d 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -161,7 +161,7 @@ alias aliases="vim /home/viktor/.bash_aliases && source /home/viktor/.bash_alias # alias ghcirun="ghci --make $1; ./$1" alias lip="ifconfig $(route -n | head -n 3 | tail -n 1 | awk '{print $8}') | grep inet | awk '{print \$2}'" -function netissue(){ +function netok(){ # ping google.com echo 'Testing DNS settings.' timeout 1 ping google.com -W 1 -c 1 &>> /dev/null @@ -177,8 +177,9 @@ function netissue(){ return 0 fi # ping gateway - echo 'Pinging default gateway' - ping $(echo $(route -n | sed -n '3p' | awk '{print $2}')) -W 1 -c 2 &>> /dev/null + gateway=$(echo $(route -n | sed -n '3p' | awk '{print $2}')) + echo 'Pinging ' $gateway + ping $gateway -W 1 -c 2 &>> /dev/null if (($? == 0 )); then echo 'Gateway connectivity issues or being firewalled.' return 0