echo DIRECT
exit 0
else
- rm $f
+ if [[ -w $f ]]; then
+ rm $f
+ fi
fi
fi
-if getent hosts $proxy_host && nc -z $proxy_host $proxy_port; then
+if getent hosts $proxy_host && nc -z $proxy_host $proxy_port &>/dev/null; then
echo $proxy_url
else
- touch $f
+ if [[ ! -e $f || -w $f ]]; then
+ touch $f
+ fi
fi