add config for cargo-deb
This commit is contained in:
parent
14f1c5addc
commit
cf8af5d173
4 changed files with 60 additions and 3 deletions
42
debian/postinst
vendored
Executable file
42
debian/postinst
vendored
Executable file
|
@ -0,0 +1,42 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
configure)
|
||||
if ! getent group | grep -q "^www-data:"; then
|
||||
echo -n "Adding group www-data.."
|
||||
addgroup --quiet --system www-data 2>/dev/null || true
|
||||
echo ".done"
|
||||
fi
|
||||
test -d /var/www || mkdir /var/www
|
||||
if ! getent passwd | grep -q "^www-data:"; then
|
||||
echo -n "Adding system user www-data.."
|
||||
adduser --quiet --system --ingroup www-data --no-create-home --disabled-password www-data 2>/dev/null || true
|
||||
echo ".done"
|
||||
fi
|
||||
usermod -c www-data -d /var/www -g www-data www-data
|
||||
if ! test -d /var/lib/subscribe-list/; then
|
||||
mkdir -m 750 /var/lib/subscribe-list/
|
||||
touch /var/lib/subscribe-list/list.db
|
||||
chmod 640 /var/lib/subscribe-list/list.db
|
||||
chown -R www-data:www-data /var/lib/subscribe-list/
|
||||
fi
|
||||
if ! test -d /etc/subscribe-list/; then
|
||||
mkdir -m 750 /etc/subscribe-list/
|
||||
install -m 640 /usr/share/subscribe-list/config.toml.sample /etc/subscribe-list/config.toml
|
||||
chown -R root:www-data /etc/subscribe-list/
|
||||
fi
|
||||
;;
|
||||
|
||||
abort-upgrade|abort-remove|abort-deconfigure)
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "postinst called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
Loading…
Add table
Add a link
Reference in a new issue