debamp/src/amp-upgrade-roundcube/usr/bin/amp-upgrade-roundcube

23 lines
567 B
Bash
Executable File

#!/bin/bash
set -e
PROJECT_URL=https://github.com/roundcube/roundcubemail/
VERSION=$(wget -qO -$PROJECT_URL/releases.atom | grep "releases/tag" | grep -o -P "/tag/[^\"]*" | sort -rV | head -n 1 | cut -c 6-)
FILE=roundcubemail-$VERSION-complete.tar.gz
TMP_PATH=$(mktemp -d)
wget -q $PROJECT_URL/releases/download/$VERSION/$FILE -O - | tar -zx -C $TMP_PATH
cd $TMP_PATH/roundcubemail-$VERSION
for tmp in $(find /etc/amp-upgrade-script/roundcube.d/ -name '*.conf')
do
source $tmp
bin/installto.sh $WEBROOT
chown $USER:$GROUP $WEBROOT -R
rm -fr $TMP_PATH
done