diff --git a/debian/config b/debian/config index 8b294e076..d988e0516 100755 --- a/debian/config +++ b/debian/config @@ -1,6 +1,10 @@ -#!/bin/sh -e +#!/bin/bash +set -eo pipefail; [[ $TRACE ]] && set -x -. /usr/share/debconf/confmodule +if [[ -e /usr/share/debconf/confmodule ]]; then + # shellcheck disable=SC1091 + . /usr/share/debconf/confmodule +fi readonly ACTION="${1:-configure}" readonly VERSION="${2:-dev}" diff --git a/debian/postinst b/debian/postinst index 43dc0780b..424c82322 100755 --- a/debian/postinst +++ b/debian/postinst @@ -1,7 +1,10 @@ #!/bin/bash set -eo pipefail; [[ $TRACE ]] && set -x -. /usr/share/debconf/confmodule +if [[ -e /usr/share/debconf/confmodule ]]; then + # shellcheck disable=SC1091 + . /usr/share/debconf/confmodule +fi readonly DOKKU_ROOT="${DOKKU_ROOT:-/home/dokku}" readonly DOKKU_LIB_ROOT="${DOKKU_LIB_PATH:-/var/lib/dokku}" diff --git a/debian/postrm b/debian/postrm index cd1a4f664..9e9feac9d 100755 --- a/debian/postrm +++ b/debian/postrm @@ -1,6 +1,11 @@ #!/bin/bash set -eo pipefail; [[ $TRACE ]] && set -x +if [[ -e /usr/share/debconf/confmodule ]]; then + # shellcheck disable=SC1091 + . /usr/share/debconf/confmodule +fi + readonly DOKKU_ROOT="${DOKKU_ROOT:-/home/dokku}" readonly DOKKU_LIB_ROOT="${DOKKU_LIB_PATH:-/var/lib/dokku}" @@ -35,10 +40,7 @@ main() { find ${DOKKU_ROOT} -type d -empty -delete fi - if [[ -e /usr/share/debconf/confmodule ]]; then - . /usr/share/debconf/confmodule - db_purge - fi + db_purge fi } diff --git a/debian/preinst b/debian/preinst index e5ae254b0..a9f11c882 100755 --- a/debian/preinst +++ b/debian/preinst @@ -1,7 +1,10 @@ #!/bin/bash set -eo pipefail; [[ $TRACE ]] && set -x -. /usr/share/debconf/confmodule +if [[ -e /usr/share/debconf/confmodule ]]; then + # shellcheck disable=SC1091 + . /usr/share/debconf/confmodule +fi case "$1" in install)