Skip to content

Commit 54c64d3

Browse files
author
Kristan Kenney
committed
Fix z-push routine in upgrade script
1 parent 8b40629 commit 54c64d3

File tree

1 file changed

+24
-11
lines changed

1 file changed

+24
-11
lines changed

install/upgrade/0.9.8-29.sh

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,16 @@ fi
8686
# Install and configure z-push
8787
if [ ! -z "$MAIL_SYSTEM" ]; then
8888
echo "(*) Installing Z-Push..."
89+
# Remove previous Z-Push configuration
90+
rm -rf /etc/z-push/*
91+
92+
# Disable apt package lock to install z-push
93+
mv /var/lib/dpkg/lock-frontend /var/lib/dpkg/lock-frontend.bak
94+
mv /var/lib/dpkg/lock /var/lib/dpkg/lock.bak
95+
mv /var/cache/apt/archives/lock /var/cache/apt/archives/lock.bak
96+
mv /var/lib/dpkg/updates/ /var/lib/dpkg/updates.bak/
97+
mkdir -p /var/lib/dpkg/updates/
98+
8999
apt="/etc/apt/sources.list.d"
90100
if [ "$os" = 'ubuntu' ]; then
91101
echo "deb http://repo.z-hub.io/z-push:/final/Ubuntu_$release/ /" > $apt/z-push.list
@@ -103,26 +113,29 @@ if [ ! -z "$MAIL_SYSTEM" ]; then
103113
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add /tmp/z-push_signing.key > /dev/null 2>&1
104114
fi
105115

106-
apt-get -qq update > /dev/null 2>&1
107-
apt-get -qq -y install z-push-common z-push-backend-imap z-push-backend-combined z-push-autodiscover > /dev/null 2>&1
116+
apt-get -qq update
117+
apt-get -qq -y install z-push-common z-push-backend-imap z-push-backend-combined z-push-autodiscover
108118

109-
# Copy configuration files
110-
if [ -z /etc/z-push/ ]; then
111-
echo "(I) Adding Z-Push configuration directory"
112-
mkdir -p /etc/z-push/
113-
fi
119+
echo "(I) Adding Z-Push configuration directory"
120+
mkdir -p /etc/z-push/
114121
cp -f $hestiacp/zpush/z-push.conf.php /etc/z-push/
115122
cp -f $hestiacp/zpush/imap.conf.php /etc/z-push/
116123

117124
# Set permissions - chmod 777 needs further testing!
118-
if [ -z /var/log/z-push ]; then
119-
echo "(I) Adding Z-Push logs directory"
120-
mkdir -p /var/log/z-push
121-
fi
125+
echo "(I) Adding Z-Push logs directory"
126+
mkdir -p /var/log/z-push
127+
122128
chmod 777 /var/lib/z-push
123129
chown -R www-data:www-data /var/lib/z-push
124130
chmod 777 /var/log/z-push
125131
chown -R www-data:www-data /var/log/z-push
132+
133+
# Enable apt package lock
134+
mv /var/lib/dpkg/lock-frontend.bak /var/lib/dpkg/lock-frontend
135+
mv /var/lib/dpkg/lock.bak /var/lib/dpkg/lock
136+
mv /var/cache/apt/archives/lock.bak /var/cache/apt/archives/lock
137+
rm -rf /var/lib/dpkg/updates/
138+
mv /var/lib/dpkg/updates.bak/ /var/lib/dpkg/updates/
126139
fi
127140

128141
# Update default page templates

0 commit comments

Comments
 (0)