mirror of
https://github.com/bashclub/zamba-lxc-toolbox.git
synced 2024-12-24 19:30:11 +01:00
Fix onlyoffice update problem
This commit is contained in:
parent
442e7a3dd5
commit
4a112950c0
25
src/onlyoffice/fix-update.sh
Normal file
25
src/onlyoffice/fix-update.sh
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
cat > /usr/local/bin/ods-apt-pre-hook << DFOE
|
||||||
|
#!/bin/bash
|
||||||
|
rm /etc/nginx/conf.d/ds-ssl.conf
|
||||||
|
systemctl stop nginx.service
|
||||||
|
DFOE
|
||||||
|
chmod +x /usr/local/bin/ods-apt-pre-hook
|
||||||
|
|
||||||
|
cat > /usr/local/bin/ods-apt-post-hook << DFOE
|
||||||
|
#!/bin/bash
|
||||||
|
rm /etc/nginx/conf.d/ds.conf
|
||||||
|
ln -sf /etc/onlyoffice/documentserver/nginx/ds-ssl.conf /etc/nginx/conf.d/ds-ssl.conf
|
||||||
|
systemctl restart nginx
|
||||||
|
DFOE
|
||||||
|
chmod +x /usr/local/bin/ods-apt-post-hook
|
||||||
|
|
||||||
|
|
||||||
|
cat << EOF > /etc/apt/apt.conf.d/80-ods-apt-pre-hook
|
||||||
|
DPkg::Pre-Invoke {"/usr/local/bin/ods-apt-pre-hook";};
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat << EOF > /etc/apt/apt.conf.d/80-ods-apt-post-hook
|
||||||
|
DPkg::Post-Invoke {"/usr/local/bin/ods-apt-post-hook";};
|
||||||
|
EOF
|
@ -44,8 +44,33 @@ openssl req -x509 -nodes -days 3650 -newkey rsa:4096 -keyout /etc/nginx/ssl/only
|
|||||||
|
|
||||||
rm /etc/nginx/conf.d/ds.conf
|
rm /etc/nginx/conf.d/ds.conf
|
||||||
cp /etc/onlyoffice/documentserver/nginx/ds-ssl.conf.tmpl /etc/onlyoffice/documentserver/nginx/ds-ssl.conf
|
cp /etc/onlyoffice/documentserver/nginx/ds-ssl.conf.tmpl /etc/onlyoffice/documentserver/nginx/ds-ssl.conf
|
||||||
|
|
||||||
|
sed -i "s|ssl_certificate {{SSL_CERTIFICATE_PATH}}|ssl_certificate /etc/nginx/ssl/onlyoffice.crt|" /etc/onlyoffice/documentserver/nginx/ds-ssl.conf
|
||||||
|
sed -i "s|ssl_certificate_key {{SSL_KEY_PATH}}|ssl_certificate_key /etc/nginx/ssl/onlyoffice.key|" /etc/onlyoffice/documentserver/nginx/ds-ssl.conf
|
||||||
|
|
||||||
ln -sf /etc/onlyoffice/documentserver/nginx/ds-ssl.conf /etc/nginx/conf.d/ds-ssl.conf
|
ln -sf /etc/onlyoffice/documentserver/nginx/ds-ssl.conf /etc/nginx/conf.d/ds-ssl.conf
|
||||||
|
|
||||||
sed -i "s|ssl_certificate {{SSL_CERTIFICATE_PATH}}|ssl_certificate /etc/nginx/ssl/onlyoffice.crt|" /etc/nginx/conf.d/ds-ssl.conf
|
cat > /usr/local/bin/ods-apt-pre-hook << DFOE
|
||||||
sed -i "s|ssl_certificate_key {{SSL_KEY_PATH}}|ssl_certificate_key /etc/nginx/ssl/onlyoffice.key|" /etc/nginx/conf.d/ds-ssl.conf
|
#!/bin/bash
|
||||||
|
rm /etc/nginx/conf.d/ds-ssl.conf
|
||||||
|
systemctl stop nginx.service
|
||||||
|
DFOE
|
||||||
|
chmod +x /usr/local/bin/ods-apt-pre-hook
|
||||||
|
|
||||||
|
cat > /usr/local/bin/ods-apt-post-hook << DFOE
|
||||||
|
#!/bin/bash
|
||||||
|
rm /etc/nginx/conf.d/ds.conf
|
||||||
|
ln -sf /etc/onlyoffice/documentserver/nginx/ds-ssl.conf /etc/nginx/conf.d/ds-ssl.conf
|
||||||
|
systemctl restart nginx
|
||||||
|
DFOE
|
||||||
|
chmod +x /usr/local/bin/ods-apt-post-hook
|
||||||
|
|
||||||
|
cat << EOF > /etc/apt/apt.conf.d/80-ods-apt-pre-hook
|
||||||
|
DPkg::Pre-Invoke {"/usr/local/bin/ods-apt-pre-hook";};
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat << EOF > /etc/apt/apt.conf.d/80-ods-apt-post-hook
|
||||||
|
DPkg::Post-Invoke {"/usr/local/bin/ods-apt-post-hook";};
|
||||||
|
EOF
|
||||||
|
|
||||||
systemctl restart nginx
|
systemctl restart nginx
|
Loading…
Reference in New Issue
Block a user