Add 'config/rainloop/update-tools.sh'
This commit is contained in:
33
config/rainloop/update-tools.sh
Normal file
33
config/rainloop/update-tools.sh
Normal file
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
### Begin update tool script
|
||||
|
||||
new_signature=$(curl -s "https://www.rainloop.net/repository/webmail/rainloop-community-latest.zip.asc")
|
||||
old_signature=$(cat "/var/log/rainloop-installed.asc" || true)
|
||||
TMPDIR=$(mktemp -d)
|
||||
|
||||
printf "RainLoop: checking for upgrades... "
|
||||
|
||||
if [ "$new_signature" != "$old_signature" ];
|
||||
then
|
||||
echo "found"
|
||||
echo "RainLoop: upgrading..."
|
||||
|
||||
wget http://www.rainloop.net/repository/webmail/rainloop-community-latest.zip -O $TMPDIR/rlcl.zip
|
||||
unzip -q $TMPDIR/rlcl.zip -d $TMPDIR
|
||||
cp -r $TMPDIR/rainloop /opt/rainloop/
|
||||
cp -r $TMPDIR/data/EMPTY /opt/rainloop/data/EMPTY
|
||||
cp -r $TMPDIR/data/VERSION /opt/rainloop/data/VERSION
|
||||
cp -r $TMPDIR/index.php /opt/rainloop/index.php
|
||||
rm -rf $TMPDIR
|
||||
chown -R www-data:www-data /opt/rainloop
|
||||
find /opt/rainloop/ -type d -exec chmod 755 {} \;
|
||||
find /opt/rainloop/ -type f -exec chmod 644 {} \;
|
||||
echo "$new_signature" > /var/log/rainloop-installed.asc
|
||||
|
||||
echo "RainLoop: upgrade complete"
|
||||
else
|
||||
echo "not found"
|
||||
fi
|
||||
echo "Done"
|
||||
|
||||
### End update tool script
|
||||
Reference in New Issue
Block a user