13 lines
361 B
Bash
Executable file
13 lines
361 B
Bash
Executable file
#!/bin/sh
|
|
|
|
# À utiliser en mettant la ligne suivante dans le fichier : /etc/apt/apt.conf.d/44proxy
|
|
# Acquire::http::Proxy-Auto-Detect "/usr/local/share/scripts-admin/apt-conf-proxy.sh";
|
|
|
|
PROXY_HOST=apt-proxy.example.net
|
|
PROXY_PORT=3142
|
|
|
|
if nc -zw1 $PROXY_HOST $PROXY_PORT 2>/dev/null >/dev/null; then
|
|
echo http://$PROXY_HOST:$PROXY_PORT/
|
|
else
|
|
echo DIRECT
|
|
fi
|