Adding new stuff
This commit is contained in:
parent
29e2b27ace
commit
1e8576de52
1 changed files with 4 additions and 3 deletions
|
|
@ -161,7 +161,7 @@ alias aliases="vim /home/viktor/.bash_aliases && source /home/viktor/.bash_alias
|
||||||
# alias ghcirun="ghci --make $1; ./$1"
|
# 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}'"
|
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
|
# ping google.com
|
||||||
echo 'Testing DNS settings.'
|
echo 'Testing DNS settings.'
|
||||||
timeout 1 ping google.com -W 1 -c 1 &>> /dev/null
|
timeout 1 ping google.com -W 1 -c 1 &>> /dev/null
|
||||||
|
|
@ -177,8 +177,9 @@ function netissue(){
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
# ping gateway
|
# ping gateway
|
||||||
echo 'Pinging default gateway'
|
gateway=$(echo $(route -n | sed -n '3p' | awk '{print $2}'))
|
||||||
ping $(echo $(route -n | sed -n '3p' | awk '{print $2}')) -W 1 -c 2 &>> /dev/null
|
echo 'Pinging ' $gateway
|
||||||
|
ping $gateway -W 1 -c 2 &>> /dev/null
|
||||||
if (($? == 0 )); then
|
if (($? == 0 )); then
|
||||||
echo 'Gateway connectivity issues or being firewalled.'
|
echo 'Gateway connectivity issues or being firewalled.'
|
||||||
return 0
|
return 0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue