30 lines
778 B
Plaintext
30 lines
778 B
Plaintext
# Manage Apt Proxy AptCacherNG
|
|
aptcacherng_conf="/etc/apt/apt.conf.d/00proxy"
|
|
aptcacherng_proto="http"
|
|
aptcacherng_address="10.0.14.50"
|
|
aptcacherng_port="3142"
|
|
|
|
|
|
apt-cache-off ()
|
|
{
|
|
if [ -f $aptcacherng_conf ] ; then
|
|
rm $aptcacherng_conf
|
|
echo "AptCacherNG now disabled"
|
|
else
|
|
echo "AptCacherNG already disabled"
|
|
fi
|
|
}
|
|
|
|
apt-cache-on ()
|
|
{
|
|
if [ -f $aptcacherng_conf ] ; then
|
|
echo "AptCacherNG already enabled"
|
|
else
|
|
echo "Acquire {" >> $aptcacherng_conf
|
|
echo " HTTP::proxy \"$aptcacherng_proto://$aptcacherng_address:$aptcacherng_port/\";" >> $aptcacherng_conf
|
|
echo " HTTPS::proxy \"$aptcacherng_proto://$aptcacherng_address:$aptcacherng_port/\";" >> $aptcacherng_conf
|
|
echo "}" >> $aptcacherng_conf
|
|
echo "AptCacherNG now enabled"
|
|
fi
|
|
}
|