2015-08-06 12:01:06 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
configure)
|
2021-11-16 03:59:05 -06:00
|
|
|
setcap cap_fowner,cap_chown,cap_mknod,cap_sys_chroot=ep /usr/bin/coolforkit || true
|
2021-11-17 11:08:27 -06:00
|
|
|
setcap cap_sys_admin=ep /usr/bin/coolmount || true
|
2022-01-18 00:44:47 -06:00
|
|
|
if [ -f /etc/loolwsd/loolwsd.xml ]; then /usr/bin/coolconfig migrateconfig --write || true; fi
|
2015-08-06 12:01:06 -05:00
|
|
|
|
2021-11-15 10:26:31 -06:00
|
|
|
adduser --quiet --system --group --home /opt/cool cool
|
2021-11-18 06:08:14 -06:00
|
|
|
chown cool: /etc/coolwsd/coolwsd.xml
|
|
|
|
chmod 640 /etc/coolwsd/coolwsd.xml
|
2015-08-06 12:01:06 -05:00
|
|
|
|
|
|
|
# We assume that the LibreOffice to be used is built TDF-style
|
2021-11-15 09:57:33 -06:00
|
|
|
# and installs in @LO_PATH@, and that /opt/cool is
|
2015-08-06 12:01:06 -05:00
|
|
|
# on the same file system
|
|
|
|
|
2021-11-15 10:26:31 -06:00
|
|
|
rm -rf /opt/cool
|
2021-11-15 09:51:11 -06:00
|
|
|
mkdir -p /opt/cool/child-roots
|
|
|
|
chown cool: /opt/cool
|
|
|
|
chown cool: /opt/cool/child-roots
|
2015-08-06 12:01:06 -05:00
|
|
|
|
2017-04-04 05:12:22 -05:00
|
|
|
fc-cache @LO_PATH@/share/fonts/truetype
|
|
|
|
|
2021-11-17 15:09:50 -06:00
|
|
|
coolwsd-systemplate-setup /opt/cool/systemplate @LO_PATH@ >/dev/null 2>&1
|
2023-07-06 14:51:58 -05:00
|
|
|
coolconfig generate-proof-key >/dev/null 2>&1
|
2021-11-18 06:08:14 -06:00
|
|
|
cat << EOF > /etc/apt/apt.conf.d/25coolwsd
|
2019-11-27 05:15:52 -06:00
|
|
|
// Rebuild systemplate of @APP_NAME@
|
2021-11-18 06:08:14 -06:00
|
|
|
DPkg::Post-Invoke { "echo Updating coolwsd systemplate;coolwsd-systemplate-setup /opt/cool/systemplate @LO_PATH@ >/dev/null 2>&1 || true"; };
|
2019-11-26 15:56:58 -06:00
|
|
|
EOF
|
2015-08-06 12:01:06 -05:00
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
|
|
|
|
2016-09-25 12:18:38 -05:00
|
|
|
#DEBHELPER#
|