mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2024-11-26 02:57:04 +00:00
Issue #449
If the downloaded file doesn't pass hash verification, the script exits and leaves a broken system Just make hash verification before moving owncloud directory
This commit is contained in:
parent
47acbbf332
commit
d8e30883fa
@ -34,16 +34,17 @@ fi
|
|||||||
if [ ! -d /usr/local/lib/owncloud/ ] \
|
if [ ! -d /usr/local/lib/owncloud/ ] \
|
||||||
|| ! grep -q $owncloud_ver /usr/local/lib/owncloud/version.php; then
|
|| ! grep -q $owncloud_ver /usr/local/lib/owncloud/version.php; then
|
||||||
|
|
||||||
|
# Download and verify
|
||||||
|
echo "installing ownCloud..."
|
||||||
|
wget_verify https://download.owncloud.org/community/owncloud-$owncloud_ver.zip $owncloud_hash /tmp/owncloud.zip
|
||||||
|
|
||||||
# Clear out the existing ownCloud.
|
# Clear out the existing ownCloud.
|
||||||
if [ ! -d /usr/local/lib/owncloud/ ]; then
|
if [ -d /usr/local/lib/owncloud/ ]; then
|
||||||
echo installing ownCloud...
|
|
||||||
else
|
|
||||||
echo "upgrading ownCloud to $owncloud_ver (backing up existing ownCloud directory to /tmp/owncloud-backup-$$)..."
|
echo "upgrading ownCloud to $owncloud_ver (backing up existing ownCloud directory to /tmp/owncloud-backup-$$)..."
|
||||||
mv /usr/local/lib/owncloud /tmp/owncloud-backup-$$
|
mv /usr/local/lib/owncloud /tmp/owncloud-backup-$$
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Download and extract ownCloud.
|
# Extract ownCloud
|
||||||
wget_verify https://download.owncloud.org/community/owncloud-$owncloud_ver.zip $owncloud_hash /tmp/owncloud.zip
|
|
||||||
unzip -u -o -q /tmp/owncloud.zip -d /usr/local/lib #either extracts new or replaces current files
|
unzip -u -o -q /tmp/owncloud.zip -d /usr/local/lib #either extracts new or replaces current files
|
||||||
rm -f /tmp/owncloud.zip
|
rm -f /tmp/owncloud.zip
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user