From 0ab5725af230a931e0392413230f878ff62acc76 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 13 Feb 2018 21:04:41 +0100 Subject: Avoid useless apt-get update, if some of the itzks packages are already installed. --- install-itzks-workstation | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'install-itzks-workstation') diff --git a/install-itzks-workstation b/install-itzks-workstation index 2614509..6b09538 100755 --- a/install-itzks-workstation +++ b/install-itzks-workstation @@ -13,7 +13,7 @@ function apt_install_if_not() { for pkg in $pkgs; do [ -d "/usr/share/doc/$pkg" ] || install_pkgs="$install_pkgs $pkg" done - test -n "$install_pkgs" && apt-get install -y $install_pkgs || true + test -n "$install_pkgs" && apt-get install -y $install_pkgs } # Add user locadm if not already there @@ -54,11 +54,9 @@ sed -r -i /etc/apt/sources.list -e "s@http.debian.net@httpredir.debian.org@g" find /var/lib/apt/lists/ -type f -delete # Get update and add itzks-keyring and itzks-systems-common package -apt-get update -apt_install_if_not itzks-keyring -apt-get update -apt_install_if_not itzks-systems-common -apt-get update +apt-get update 1>/dev/null +apt_install_if_not itzks-keyring && apt-get update 1>/dev/null +apt_install_if_not itzks-systems-common && apt-get update 1>/dev/null # Install the itzks-systems-workstation package apt_install_if_not ocsinventory-agent -- cgit v1.2.3