mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
trying a patch fix for slow remote connections
This commit is contained in:
parent
eaed735103
commit
421ecfd430
18
inxi
18
inxi
|
@ -3,7 +3,7 @@
|
||||||
#### Script Name: inxi
|
#### Script Name: inxi
|
||||||
#### Version: 1.9.02
|
#### Version: 1.9.02
|
||||||
#### Date: May 17 2013
|
#### Date: May 17 2013
|
||||||
#### Patch Number: 00
|
#### Patch Number: 01
|
||||||
########################################################################
|
########################################################################
|
||||||
#### SPECIAL THANKS
|
#### SPECIAL THANKS
|
||||||
########################################################################
|
########################################################################
|
||||||
|
@ -5825,7 +5825,7 @@ get_networking_wan_ip_data()
|
||||||
# awk has bad regex handling so checking it with grep -E instead
|
# awk has bad regex handling so checking it with grep -E instead
|
||||||
# ip=$( echo 2001:0db8:85a3:0000:0000:8a2e:0370:7334 | gawk --re-interval '
|
# ip=$( echo 2001:0db8:85a3:0000:0000:8a2e:0370:7334 | gawk --re-interval '
|
||||||
# ip=$( wget -q -O - $WAN_IP_URL | gawk --re-interval '
|
# ip=$( wget -q -O - $WAN_IP_URL | gawk --re-interval '
|
||||||
ip=$( wget -t 1 -T 4 -q -O - $WAN_IP_URL | gawk --re-interval '
|
ip=$( wget -t 1 -T 6 -q -O - $WAN_IP_URL | gawk --re-interval '
|
||||||
{
|
{
|
||||||
#gsub("\n","",$2")
|
#gsub("\n","",$2")
|
||||||
print $NF
|
print $NF
|
||||||
|
@ -7983,10 +7983,10 @@ get_weather_data()
|
||||||
else
|
else
|
||||||
if [[ $b_test_loc != 'true' ]];then
|
if [[ $b_test_loc != 'true' ]];then
|
||||||
# make sure location site is up
|
# make sure location site is up
|
||||||
wget -q -t 1 -T 5 --spider $location_site || wget_error=$?
|
wget -q -t 1 -T 8 --spider $location_site || wget_error=$?
|
||||||
# grab the location xml file
|
# grab the location xml file
|
||||||
if [[ $wget_error -eq 0 ]];then
|
if [[ $wget_error -eq 0 ]];then
|
||||||
location_data=$( wget -q -t 1 -T 5 -O- $location_site || wget_error=$? )
|
location_data=$( wget -q -t 1 -T 8 -O- $location_site || wget_error=$? )
|
||||||
else
|
else
|
||||||
data_grab_error="Error: unable to connect to location server - wget: $wget_error"
|
data_grab_error="Error: unable to connect to location server - wget: $wget_error"
|
||||||
fi
|
fi
|
||||||
|
@ -8000,7 +8000,9 @@ get_weather_data()
|
||||||
data_grab_error="Error: location xml local file not found."
|
data_grab_error="Error: location xml local file not found."
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [[ -z $( grep -i '<Response' <<< $location_data ) ]];then
|
if [[ -n $data_grab_error ]];then
|
||||||
|
:
|
||||||
|
elif [[ -z $( grep -i '<Response' <<< $location_data ) ]];then
|
||||||
data_grab_error="Error: location downloaded but data contains no xml."
|
data_grab_error="Error: location downloaded but data contains no xml."
|
||||||
else
|
else
|
||||||
# clean up xml and make easy to process with newlines, note, bsd sed has no support for inserting
|
# clean up xml and make easy to process with newlines, note, bsd sed has no support for inserting
|
||||||
|
@ -8093,7 +8095,7 @@ get_weather_data()
|
||||||
echo "location: $location"
|
echo "location: $location"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z $location ]];then
|
if [[ -z $location && -z $data_grab_error ]];then
|
||||||
data_grab_error="Error: location data downloaded but no location detected."
|
data_grab_error="Error: location data downloaded but no location detected."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -8102,10 +8104,10 @@ get_weather_data()
|
||||||
A_WEATHER_DATA=$data_grab_error
|
A_WEATHER_DATA=$data_grab_error
|
||||||
else
|
else
|
||||||
if [[ $b_test_weather != 'true' ]];then
|
if [[ $b_test_weather != 'true' ]];then
|
||||||
wget -q -t 1 -T 5 --spider $weather_spider || wget_error=$?
|
wget -q -t 1 -T 8 --spider $weather_spider || wget_error=$?
|
||||||
# grab the weather feed xml file
|
# grab the weather feed xml file
|
||||||
if [[ $wget_error -eq 0 ]];then
|
if [[ $wget_error -eq 0 ]];then
|
||||||
weather_data="$( wget -q -t 1 -T 5 -O- $weather_feed"$location" || wget_error=$? )"
|
weather_data="$( wget -q -t 1 -T 8 -O- $weather_feed"$location" || wget_error=$? )"
|
||||||
else
|
else
|
||||||
data_grab_error="Error: unable to connect to weather server - wget: $wget_error"
|
data_grab_error="Error: unable to connect to weather server - wget: $wget_error"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue