openwebrx-clone/debian/openwebrx.postinst

26 lines
656 B
Plaintext
Raw Normal View History

#!/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
2021-02-10 23:24:02 +00:00
chown "${OWRX_USER}". ${OWRX_DATADIR}
2021-02-06 17:59:01 +00:00
# create initial openwebrx user
openwebrx-admin adduser --noninteractive --silent --user admin
;;
*)
echo "postinst called with unknown argument '$1'" 1>&2
exit 1
;;
esac
#DEBHELPER#