From 2bcbd2c04f42997338e03c7e07ac3a5af1e53d8e Mon Sep 17 00:00:00 2001 From: David Beniamine <david.beniamine@tetras-libre.fr> Date: Sat, 9 Feb 2019 12:10:38 +0100 Subject: [PATCH] installAptCacher.sh --- installAptCacher.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 installAptCacher.sh diff --git a/installAptCacher.sh b/installAptCacher.sh new file mode 100755 index 0000000..2fec60d --- /dev/null +++ b/installAptCacher.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +apt-get update +apt-get -y install apt-cacher-ng + +sed -i -e 's/^# \(Port:3142\)/\1/' /etc/apt-cacher-ng/acng.conf + +systemctl start apt-cacher-ng.service +systemctl enable apt-cacher-ng.service + +if [ -z "`grep Acquire::Http::Proxy /etc/apt/apt.conf.d/70debconf`" ] +then + echo 'Acquire::Http::Proxy "http://127.0.0.1:3142";' >> \ + /etc/apt/apt.conf.d/70debconf +fi + +ufw allow from $(ip a | awk '/inet .* (eth|enp)/{print $2}') to any port 3142 -- GitLab