lib/testlab/provisioners/templates/apt_cacher_ng/provision.erb in testlab-1.2.3 vs lib/testlab/provisioners/templates/apt_cacher_ng/provision.erb in testlab-1.3.0
- old
+ new
@@ -1,12 +1,10 @@
set -x
set -e
-[[ -f /.testlab-apt-cacher-ng-provision ]] && exit 0
-
export DEBIAN_FRONTEND="noninteractive"
-apt-get -y install apt-cacher-ng
-service apt-cacher-ng restart || service apt-cacher-ng start
-grep "^MIRROR" /etc/default/lxc || (echo 'MIRROR="http://127.0.0.1:3142/archive.ubuntu.com/ubuntu"' | tee -a /etc/default/lxc)
-
-touch /.testlab-apt-cacher-ng-provision
+if ! dpkg --status apt-cacher-ng &> /dev/null; then
+ apt-get -y install apt-cacher-ng
+ service apt-cacher-ng restart || service apt-cacher-ng start
+ grep "^MIRROR" /etc/default/lxc || (echo 'MIRROR="http://127.0.0.1:3142/archive.ubuntu.com/ubuntu"' | tee -a /etc/default/lxc)
+fi