From 54fb58755d03cabc12bab8a5047b468da2e50640 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sat, 6 Feb 2021 15:50:50 +0100 Subject: [PATCH] add openwebrx data directory for persistent files --- debian/openwebrx.postinst | 22 ++++++++++++++++++++++ debian/postinst | 7 ------- 2 files changed, 22 insertions(+), 7 deletions(-) create mode 100755 debian/openwebrx.postinst delete mode 100755 debian/postinst diff --git a/debian/openwebrx.postinst b/debian/openwebrx.postinst new file mode 100755 index 0000000..fdb757f --- /dev/null +++ b/debian/openwebrx.postinst @@ -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# diff --git a/debian/postinst b/debian/postinst deleted file mode 100755 index 423db2c..0000000 --- a/debian/postinst +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -set -euxo pipefail - -adduser --system --group --no-create-home --home /nonexistent --quiet openwebrx -usermod -aG plugdev openwebrx - -#DEBHELPER#