Fixed wget hanging dwmbar

This commit is contained in:
Archie Hilton (thytom) 2019-11-07 21:51:37 +00:00
parent bff03413ac
commit 858e26828f

14
dwmbar
View file

@ -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