From 3f0d2fc9cf63a274776efc0c653f1e9d30e53183 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 13 Feb 2018 21:07:03 +0100 Subject: apt_install_if_not: Catch apt-get exit code and return that. --- install-itzks-workstation | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/install-itzks-workstation b/install-itzks-workstation index 575c61d..3063168 100755 --- a/install-itzks-workstation +++ b/install-itzks-workstation @@ -13,7 +13,11 @@ function apt_install_if_not() { for pkg in $pkgs; do [ -d "/usr/share/doc/$pkg" ] || install_pkgs="$install_pkgs $pkg" done + set +e test -n "$install_pkgs" && apt-get install -y $install_pkgs + ret=$? + set -e + return $ret } # Add user locadm if not already there -- cgit v1.2.3