Commit 4d64246b authored by Joshua Tauberer's avatar Joshua Tauberer

tweak z-push/owncloud installation scripts: hide output, check if z-push needs...

tweak z-push/owncloud installation scripts: hide output, check if z-push needs an update, dont use /etc/timezone because its contents would need to be escaped before being passed into sed
parent 9d6dc78b
...@@ -17,7 +17,7 @@ if [ ! -d /usr/local/lib/owncloud ]; then ...@@ -17,7 +17,7 @@ if [ ! -d /usr/local/lib/owncloud ]; then
echo Installing ownCloud... echo Installing ownCloud...
rm -f /tmp/owncloud.zip rm -f /tmp/owncloud.zip
wget -qO /tmp/owncloud.zip https://download.owncloud.org/community/owncloud-7.0.1.zip wget -qO /tmp/owncloud.zip https://download.owncloud.org/community/owncloud-7.0.1.zip
unzip /tmp/owncloud.zip -d /usr/local/lib unzip -q /tmp/owncloud.zip -d /usr/local/lib
rm -f /tmp/owncloud.zip rm -f /tmp/owncloud.zip
fi fi
...@@ -75,7 +75,7 @@ chmod -R 777 /usr/local/lib/owncloud/apps/mail/vendor/ezyang/htmlpurifier/librar ...@@ -75,7 +75,7 @@ chmod -R 777 /usr/local/lib/owncloud/apps/mail/vendor/ezyang/htmlpurifier/librar
# Use Crontab instead of AJAX/webcron in ownCloud # Use Crontab instead of AJAX/webcron in ownCloud
# TODO: somehow change the cron option in ownClouds config, not exposed afaik? # TODO: somehow change the cron option in ownClouds config, not exposed afaik?
(crontab -u www-user -l; echo "*/15 * * * * php -f /usr/local/lib/owncloud/cron.php" ) | crontab -u www-user - (crontab -u www-data -l; echo "*/15 * * * * php -f /usr/local/lib/owncloud/cron.php" ) | crontab -u www-data -
php5enmod imap php5enmod imap
restart_service php5-fpm restart_service php5-fpm
...@@ -19,20 +19,29 @@ apt_install \ ...@@ -19,20 +19,29 @@ apt_install \
php5enmod imap php5enmod imap
# Copy Z-Push into place. # Copy Z-Push into place.
if [ ! -d /usr/local/lib/z-push ]; then needs_update=0
if [ ! -f /usr/local/lib/z-push/version ]; then
needs_update=1
elif [[ `curl -s https://api.github.com/repos/fmbiete/Z-Push-contrib/git/refs/heads/master` != `cat /usr/local/lib/z-push/version` ]]; then
# checks if the version
needs_update=1
fi
if [ $needs_update == 1 ]; then
rm -rf /usr/local/lib/z-push
rm -f /tmp/zpush.zip rm -f /tmp/zpush.zip
echo Installing z-push... echo Installing z-push \(fmbiete fork\)...
wget -qO /tmp/zpush.zip https://github.com/fmbiete/Z-Push-contrib/archive/master.zip wget -qO /tmp/zpush.zip https://github.com/fmbiete/Z-Push-contrib/archive/master.zip
unzip /tmp/zpush.zip -d /usr/local/lib/ unzip -q /tmp/zpush.zip -d /usr/local/lib/
mv /usr/local/lib/Z-Push-contrib-master /usr/local/lib/z-push mv /usr/local/lib/Z-Push-contrib-master /usr/local/lib/z-push
rm -f /usr/sbin/z-push-{admin,top}
ln -s /usr/local/lib/z-push/z-push-admin.php /usr/sbin/z-push-admin ln -s /usr/local/lib/z-push/z-push-admin.php /usr/sbin/z-push-admin
ln -s /usr/local/lib/z-push/z-push-top.php /usr/sbin/z-push-top ln -s /usr/local/lib/z-push/z-push-top.php /usr/sbin/z-push-top
rm /tmp/zpush.zip; rm /tmp/zpush.zip;
curl -s https://api.github.com/repos/fmbiete/Z-Push-contrib/git/refs/heads/master > /usr/local/lib/z-push/version
fi fi
# Configure default config # Configure default config.
TIMEZONE=`cat /etc/timezone` sed -i "s/define('TIMEZONE', .*/define('TIMEZONE', 'Etc\/UTC');/" /usr/local/lib/z-push/config.php
sed -i "s/define('TIMEZONE', .*/define('TIMEZONE', '$TIMEZONE');/" /usr/local/lib/z-push/config.php
sed -i "s/define('BACKEND_PROVIDER', .*/define('BACKEND_PROVIDER', 'BackendCombined');/" /usr/local/lib/z-push/config.php sed -i "s/define('BACKEND_PROVIDER', .*/define('BACKEND_PROVIDER', 'BackendCombined');/" /usr/local/lib/z-push/config.php
# Configure BACKEND # Configure BACKEND
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment