iankelling.org
/
git
/
distro-setup
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixes and new bashrc func
[distro-setup]
/
filesystem
/
etc
/
apt
/
detect-http-proxy
diff --git
a/filesystem/etc/apt/detect-http-proxy
b/filesystem/etc/apt/detect-http-proxy
index a6d1d6fb77fa00b08ca1a7286fa40fcb9e9f4253..1cfdaf978b878dd6f76aa2e94c371a8fcfb902db 100755
(executable)
--- a/
filesystem/etc/apt/detect-http-proxy
+++ b/
filesystem/etc/apt/detect-http-proxy
@@
-11,6
+11,10
@@
proxy_host=faiserver
proxy_port=3142
proxy_url=http://$proxy_host:$proxy_port/
f=/tmp/apt_proxy_fail
proxy_port=3142
proxy_url=http://$proxy_host:$proxy_port/
f=/tmp/apt_proxy_fail
+if [[ ! -w /tmp ]]; then
+ echo DIRECT
+ exit 0
+fi
if [[ -r $f ]]; then
if (( $(( $(date +%s) - $(stat -c %Y $f ) )) < 60*10 )); then
echo DIRECT
if [[ -r $f ]]; then
if (( $(( $(date +%s) - $(stat -c %Y $f ) )) < 60*10 )); then
echo DIRECT
@@
-21,7
+25,7
@@
if [[ -r $f ]]; then
fi
fi
fi
fi
fi
fi
-if getent hosts $proxy_host &
&
nc -z $proxy_host $proxy_port &>/dev/null; then
+if getent hosts $proxy_host &
>/dev/null && timeout 1
nc -z $proxy_host $proxy_port &>/dev/null; then
echo $proxy_url
else
if [[ ! -e $f || -w $f ]]; then
echo $proxy_url
else
if [[ ! -e $f || -w $f ]]; then