debian-packages/debhelper/remark42-bin/debian/preinst

37 lines
1 KiB
Plaintext
Raw Permalink Normal View History

#!/usr/bin/env bash
case "$1" in
install|upgrade)
if ! getent group | grep -q "^remark42:" ; then
echo -n "Adding group remark42.."
addgroup --quiet --system remark42 2> /dev/null || true
echo "..done"
fi
test -d /var/lib/remark42 || mkdir /var/lib/remark42
if ! getent passwd | grep -q "^remark42:" ; then
echo -n "Adding system user remark42.."
adduser --quiet \
--system \
--ingroup "remark42" \
--no-create-home \
--disabled-password \
remark42 2> /dev/null || true
echo "..done"
fi
usermod --comment "Remark42 (A comment engine)" \
--home "/var/lib/remark42" \
--gid "remark42" \
--shell "/usr/bin/bash" \
remark42
if ! dpkg-statoverride --list "/var/lib/remark42" > /dev/null ; then
chown -R remark42:remark42 /var/lib/remark42
chmod u=rwx,g=rx,o= /var/lib/remark42
fi
;;
esac
#DEBHELPER#