summaryrefslogtreecommitdiffstats
path: root/config/chroot_local-includes/usr/local/lib/tails-shell-library/common.sh
diff options
context:
space:
mode:
Diffstat (limited to 'config/chroot_local-includes/usr/local/lib/tails-shell-library/common.sh')
-rw-r--r--config/chroot_local-includes/usr/local/lib/tails-shell-library/common.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/config/chroot_local-includes/usr/local/lib/tails-shell-library/common.sh b/config/chroot_local-includes/usr/local/lib/tails-shell-library/common.sh
index 071196b..8677913 100644
--- a/config/chroot_local-includes/usr/local/lib/tails-shell-library/common.sh
+++ b/config/chroot_local-includes/usr/local/lib/tails-shell-library/common.sh
@@ -79,3 +79,12 @@ no_abort() {
fi
return 0
}
+
+is_package_installed() {
+ local package_name package_status
+ package_name="${1}"
+ package_status="$(no_abort dpkg-query --show \
+ --showformat='${db:Status-Status}' "${package_name}" \
+ 2>/dev/null)"
+ [ "${package_status}" = "installed" ]
+}