diff --git a/debian/openwebrx.postinst b/debian/openwebrx.postinst index 585a204..21f7363 100755 --- a/debian/openwebrx.postinst +++ b/debian/openwebrx.postinst @@ -1,6 +1,8 @@ #!/bin/bash set -euo pipefail +. /usr/share/debconf/confmodule + OWRX_USER="openwebrx" OWRX_DATADIR="/var/lib/openwebrx" @@ -14,7 +16,12 @@ case "$1" in chown "${OWRX_USER}". ${OWRX_DATADIR} # create initial openwebrx user - openwebrx-admin --noninteractive --silent adduser admin + db_get openwebrx/admin_user_password + if [ "${RET}" != "__DONE__" ]; then + OWRX_PASSWORD="${RET}" openwebrx-admin --noninteractive --silent adduser admin + fi + # remove actual password from debconf database, but leave a marker + db_set openwebrx/admin_user_password "__DONE__" ;; *) echo "postinst called with unknown argument '$1'" 1>&2 diff --git a/debian/openwebrx.postrm b/debian/openwebrx.postrm new file mode 100644 index 0000000..ed7b4e9 --- /dev/null +++ b/debian/openwebrx.postrm @@ -0,0 +1,6 @@ +#!/bin/sh -e + +if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then + . /usr/share/debconf/confmodule + db_purge +fi \ No newline at end of file