libreoffice-online/loolwsd/debian/loolwsd.postinst

34 lines
886 B
Text
Raw Normal View History

#!/bin/sh
set -e
case "$1" in
configure)
setcap cap_fowner,cap_mknod,cap_sys_chroot=ep /usr/bin/loolforkit || true
adduser --quiet --system --group --home /opt/lool lool
2016-01-08 02:24:47 -06:00
mkdir -p /var/cache/loolwsd && chown lool: /var/cache/loolwsd
rm -rf /var/cache/loolwsd/*
# We assume that the LibreOffice to be used is built TDF-style
2015-10-30 07:18:35 -05:00
# and installs in /opt/collaboraoffice5.0, and that /opt/lool is
# on the same file system
rm -rf /opt/lool
mkdir -p /opt/lool/child-roots
2016-01-08 02:24:47 -06:00
chown lool: /opt/lool
chown lool: /opt/lool/child-roots
2015-10-30 07:18:35 -05:00
su lool --shell=/bin/sh -c "loolwsd-systemplate-setup /opt/lool/systemplate /opt/collaboraoffice5.0 >/dev/null"
;;
esac
if [ -d /run/systemd/system ]; then
systemctl --system daemon-reload >/dev/null || true
systemctl enable loolwsd.service >/dev/null || true
deb-systemd-invoke start loolwsd.service >/dev/null || true
fi
exit 0