Switched from Rainloop to SnappyMail since it seems to be abandoned
This commit is contained in:
24
Resources/UpdateSnappyMail.sh
Normal file
24
Resources/UpdateSnappyMail.sh
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/bin/ash
|
||||
##Script for updating SnappyMailVer
|
||||
NewSnappyMailVer=$(curl -s https://api.github.com/repos/the-djmaze/snappymail/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " ")
|
||||
|
||||
printf "SnappyMail: checking for upgrades... "
|
||||
|
||||
if [ "$NewSnappyMailVer" != "$(cat /opt/SnappyMail-installed)" ];
|
||||
then
|
||||
echo "update found"
|
||||
#Backup Config
|
||||
mv /opt/webmail/data/_data_ /tmp/_data_
|
||||
rm -rf /opt/webmail
|
||||
curl -L https://github.com/the-djmaze/snappymail/releases/download/$NewSnappyMailVer/snappymail-${NewSnappyMailVer//v}.tar.gz -o /tmp/smc.tar.gz || exit 1
|
||||
tar -C /opt/webmail -xzf /tmp/smc.tar.gz
|
||||
chown -R nginx:nginx /opt/webmail
|
||||
find /opt/webmail/ -type d -exec chmod 755 {} \;
|
||||
find /opt/webmail/ -type f -exec chmod 644 {} \;
|
||||
echo $NewSnappyMailVer > /opt/webmail-installed
|
||||
#Restore config
|
||||
mv /tmp/_data_ /opt/webmail/data/_data_
|
||||
echo "upgrade complete"
|
||||
else
|
||||
echo "update not found"
|
||||
fi
|
||||
Reference in New Issue
Block a user