Merge pull request #6 from ungleich/b/rerunable
make it rerunable, => not trying to install nextcloud if it's already installed
This commit is contained in:
commit
f50f61ecb2
1 changed files with 12 additions and 15 deletions
|
@ -45,21 +45,18 @@ admin_pass=$(cat "$__object/parameter/admin-pass")
|
|||
domain=$(cat "$__object/parameter/domain")
|
||||
|
||||
# TODO check shasum of tar ball
|
||||
# TODO: Make this Work!!
|
||||
#if [ -d /var/www/nextcloud -a \$(cd /var/www/nextcloud; sudo -u www-data php occ status | grep -o true) ]; then
|
||||
# INSTALL_STATE=true
|
||||
#else
|
||||
# INSTALL_STATE=false
|
||||
#fi
|
||||
#echo \${INSTALL_STATE} > /tmp/install-state
|
||||
#if [ "\$INSTALL_STATE" != "true" ]; then
|
||||
cat <<eof
|
||||
curl -s -L ${nextcloud_uri} -o /tmp/nextcloud.tar.bz2
|
||||
tar -C /var/www -xvjf /tmp/nextcloud.tar.bz2
|
||||
rm -f /tmp/nextcloud.tar.bz2
|
||||
chown -R www-data:www-data /var/www/nextcloud
|
||||
cd /var/www/nextcloud
|
||||
sudo -u www-data php occ maintenance:install --database "pgsql" --database-name "$db_name" --database-user "$db_user" --database-pass "$db_pass" --admin-user "$admin_user" --admin-pass "$admin_pass"
|
||||
sudo -u www-data php occ config:system:set trusted_domains 2 --value="$domain"
|
||||
if [ -d /var/www/nextcloud 2>/dev/null -a \$(cd /var/www/nextcloud 2>/dev/null; sudo -u www.data php occ status 2>/dev/null | grep -o true) ]; then
|
||||
echo "Nextcloud already installed" >&2
|
||||
else
|
||||
echo "installing nextcloud" >&2
|
||||
curl -s -L ${nextcloud_uri} -o /tmp/nextcloud.tar.bz2
|
||||
tar -C /var/www -xvjf /tmp/nextcloud.tar.bz2
|
||||
rm -f /tmp/nextcloud.tar.bz2
|
||||
chown -R www-data:www-data /var/www/nextcloud
|
||||
cd /var/www/nextcloud
|
||||
sudo -u www-data php occ maintenance:install --database "pgsql" --database-name "$db_name" --database-user "$db_user" --database-pass "$db_pass" --admin-user "$admin_user" --admin-pass "$admin_pass"
|
||||
sudo -u www-data php occ config:system:set trusted_domains 2 --value="$domain"
|
||||
fi
|
||||
eof
|
||||
#fi
|
||||
|
|
Loading…
Reference in a new issue