2015-08-06 12:01:06 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
configure)
|
2016-03-01 10:22:55 -06:00
|
|
|
setcap cap_fowner,cap_mknod,cap_sys_chroot=ep /usr/bin/loolbroker || true
|
2015-08-06 12:01:06 -05:00
|
|
|
|
|
|
|
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
|
2016-01-08 02:11:58 -06:00
|
|
|
rm -rf /var/cache/loolwsd/*
|
2015-08-06 12:01:06 -05:00
|
|
|
|
|
|
|
# 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
|
2015-08-06 12:01:06 -05:00
|
|
|
# on the same file system
|
|
|
|
|
2016-01-08 02:22:28 -06:00
|
|
|
rm -rf /opt/lool
|
2015-08-06 12:01:06 -05:00
|
|
|
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-08-06 12:01:06 -05:00
|
|
|
|
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"
|
2015-08-06 12:01:06 -05:00
|
|
|
;;
|
|
|
|
|
|
|
|
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
|