apt-cacher-ng

This commit is contained in:
deathbybandaid 2022-02-01 14:18:58 -05:00
parent e0ca7629d7
commit 390015c189

29
apt-cacher-ng.aliases Normal file
View File

@ -0,0 +1,29 @@
# 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
}