2016-06-03 16:27:39 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-10-14 16:08:49 +03:00
|
|
|
# T&M Hansson IT AB © - 2018, https://www.hanssonit.se/
|
2016-06-03 16:27:39 +03:00
|
|
|
|
2017-04-09 23:43:30 +03:00
|
|
|
# shellcheck disable=2034,2059
|
|
|
|
true
|
|
|
|
# shellcheck source=lib.sh
|
|
|
|
. <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/master/lib.sh)
|
2016-06-03 16:27:39 +03:00
|
|
|
|
2017-04-09 23:43:30 +03:00
|
|
|
# Check for errors + debug code and abort if something isn't right
|
|
|
|
# 1 = ON
|
|
|
|
# 0 = OFF
|
|
|
|
DEBUG=0
|
|
|
|
debug_mode
|
2016-06-03 16:27:39 +03:00
|
|
|
|
2017-04-09 23:43:30 +03:00
|
|
|
download_static_script update-config
|
|
|
|
if [ -f $SCRIPTS/update-config.php ]
|
|
|
|
then
|
|
|
|
# Change config.php
|
|
|
|
php $SCRIPTS/update-config.php $NCPATH/config/config.php 'trusted_domains[]' localhost "${ADDRESS[@]}" "$(hostname)" "$(hostname --fqdn)" >/dev/null 2>&1
|
|
|
|
php $SCRIPTS/update-config.php $NCPATH/config/config.php overwrite.cli.url https://"$(hostname --fqdn)"/ >/dev/null 2>&1
|
|
|
|
|
|
|
|
# Change .htaccess accordingly
|
|
|
|
sed -i "s|RewriteBase /nextcloud|RewriteBase /|g" $NCPATH/.htaccess
|
|
|
|
|
|
|
|
# Cleanup
|
|
|
|
rm -f $SCRIPTS/update-config.php
|
|
|
|
fi
|