mirror of
https://git.myvelabs.com/docker/myvemail.git
synced 2026-06-17 06:39:14 +00:00
Update build/run/bin/upgrade-postfixadmin
Slightly reduce downtime in postfixadmin upgrade script. Temporary download directory added, cleanup upon close.
This commit is contained in:
parent
0de55c7cfc
commit
723113f0eb
1 changed files with 12 additions and 2 deletions
|
|
@ -2,13 +2,16 @@
|
||||||
# Installer for updating Postfixadmin
|
# Installer for updating Postfixadmin
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
# Create temporary directory
|
||||||
|
workdir=$(mktemp -d)
|
||||||
|
|
||||||
# Backup postfixadmin config
|
# Backup postfixadmin config
|
||||||
cd /tmp/
|
cd ${workdir}/
|
||||||
cp /usr/share/webapps/postfixadmin/config.local.php .
|
cp /usr/share/webapps/postfixadmin/config.local.php .
|
||||||
rm -r /usr/share/webapps/postfixadmin/
|
|
||||||
|
|
||||||
# Download latest version
|
# Download latest version
|
||||||
wget -q4 https://github.com/postfixadmin/postfixadmin/archive/refs/tags/$(wget -q4O- https://api.github.com/repos/postfixadmin/postfixadmin/releases/latest | grep tag_name | awk '{print $2}' | tr -d '"|,').tar.gz -O postfixadmin.tar.gz
|
wget -q4 https://github.com/postfixadmin/postfixadmin/archive/refs/tags/$(wget -q4O- https://api.github.com/repos/postfixadmin/postfixadmin/releases/latest | grep tag_name | awk '{print $2}' | tr -d '"|,').tar.gz -O postfixadmin.tar.gz
|
||||||
|
mv /usr/share/webapps/postfixadmin/ /usr/share/webapps/postfixadmin.bkp/
|
||||||
mkdir -p /usr/share/webapps/postfixadmin/
|
mkdir -p /usr/share/webapps/postfixadmin/
|
||||||
tar zxf postfixadmin.tar.gz -C /usr/share/webapps/postfixadmin --strip-components 1
|
tar zxf postfixadmin.tar.gz -C /usr/share/webapps/postfixadmin --strip-components 1
|
||||||
|
|
||||||
|
|
@ -18,3 +21,10 @@ setfacl -R -m u:${MYVEMAIL_NGINX_USERGROUP}:rwx /usr/share/webapps/postfixadmin/
|
||||||
|
|
||||||
# Return config
|
# Return config
|
||||||
mv config.local.php /usr/share/webapps/postfixadmin/
|
mv config.local.php /usr/share/webapps/postfixadmin/
|
||||||
|
|
||||||
|
# Run new install script
|
||||||
|
cd /usr/share/webapps/postfixadmin/
|
||||||
|
bash ./install.sh
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
rm -r ${workdir}/ /usr/share/webapps/postfixadmin.bkp/
|
||||||
Loading…
Add table
Add a link
Reference in a new issue