mirror of
https://git.adityakumar.xyz/dwmbar.git
synced 2024-12-23 05:22:53 +00:00
Fixed wget hanging dwmbar
This commit is contained in:
parent
bff03413ac
commit
858e26828f
1 changed files with 9 additions and 5 deletions
14
dwmbar
14
dwmbar
|
@ -89,12 +89,9 @@ while getopts 'vc' flag; do
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
check_files
|
check_internet() {
|
||||||
|
|
||||||
while :; do
|
|
||||||
date=$(date +'%S')
|
|
||||||
if [ $(( 10#$date % 5 )) -eq 0 ]; then
|
if [ $(( 10#$date % 5 )) -eq 0 ]; then
|
||||||
wget --spider -q www.google.com
|
wget --spider -q www.google.com --timeout=3
|
||||||
|
|
||||||
if [[ $? -eq 0 ]]; then
|
if [[ $? -eq 0 ]]; then
|
||||||
INTERNET=0
|
INTERNET=0
|
||||||
|
@ -102,5 +99,12 @@ while :; do
|
||||||
INTERNET=1
|
INTERNET=1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_files
|
||||||
|
|
||||||
|
while :; do
|
||||||
|
date=$(date +'%S')
|
||||||
|
check_internet &
|
||||||
xsetroot -name "$(exec $DEFAULT_BAR_LOCATION)"
|
xsetroot -name "$(exec $DEFAULT_BAR_LOCATION)"
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in a new issue