24 lines
906 B
Bash
24 lines
906 B
Bash
#!/bin/ash
|
|
##Script for updating RainLoop
|
|
NewRainLoopVer=$(curl -s https://api.github.com/repos/RainLoop/rainloop-webmail/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " ")
|
|
|
|
printf "RainLoop: checking for upgrades... "
|
|
|
|
if [ "$NewRainLoopVer" != "$(cat /opt/rainloop-installed)" ];
|
|
then
|
|
echo "update found"
|
|
#Backup Config
|
|
mv /opt/rainloop/data/_data_ /tmp/_data_
|
|
rm -rf /opt/rainloop
|
|
curl http://www.rainloop.net/repository/webmail/rainloop-community-latest.zip -o /tmp/rlcl.zip
|
|
unzip -q /tmp/rlcl.zip -d /opt/rainloop
|
|
chown -R nginx:nginx /opt/rainloop
|
|
find /opt/rainloop/ -type d -exec chmod 755 {} \;
|
|
find /opt/rainloop/ -type f -exec chmod 644 {} \;
|
|
echo $NewRainLoopVer > /opt/rainloop-installed
|
|
#Restore config
|
|
mv /tmp/_data_ /opt/rainloop/data/_data_
|
|
echo "upgrade complete"
|
|
else
|
|
echo "update not found"
|
|
fi |