add openwebrx data directory for persistent files

This commit is contained in:
Jakob Ketterl 2021-02-06 15:50:50 +01:00
parent d9b662106c
commit 54fb58755d
2 changed files with 22 additions and 7 deletions

22
debian/openwebrx.postinst vendored Executable file
View File

@ -0,0 +1,22 @@
#!/bin/bash
set -euxo pipefail
OWRX_USER="openwebrx"
OWRX_DATADIR="/var/lib/openwebrx"
case "$1" in
configure)
adduser --system --group --no-create-home --home /nonexistent --quiet "${OWRX_USER}"
usermod -aG plugdev openwebrx
# create OpenWebRX data directory and set the correct permissions
if [ ! -d "${OWRX_DATADIR}" ] && [ ! -L "${OWRX_DATADIR}" ]; then mkdir "${OWRX_DATADIR}"; fi
chown -R "${OWRX_USER}". ${OWRX_DATADIR}
;;
*)
echo "postinst called with unknown argument '$1'" 1>&2
exit 1
;;
esac
#DEBHELPER#

7
debian/postinst vendored
View File

@ -1,7 +0,0 @@
#!/bin/bash
set -euxo pipefail
adduser --system --group --no-create-home --home /nonexistent --quiet openwebrx
usermod -aG plugdev openwebrx
#DEBHELPER#