feat(Nextcloud): install specific version

This commit is contained in:
EV21 committed 2022-03-24 17:42:22 +01:00
1 parent 50a03353db
commit 58b01255af
1 file changed
+34 -4
+34 -4
View File
@@ -20,7 +20,7 @@ function install_nextcloud
if [ "$(ls --almost-all ~/html/)" ]; then echo '~/html is not empty, abort!'; exit 1; fi if [ "$(ls --almost-all ~/html/)" ]; then echo '~/html is not empty, abort!'; exit 1; fi
cd ~/html cd ~/html
echo "Downloading Nextcloud to ~/html/" echo "Downloading Nextcloud to ~/html/"
curl --progress-bar https://download.nextcloud.com/server/releases/latest.tar.bz2 | curl --progress-bar https://download.nextcloud.com/server/releases/"$(get_version_name)".tar.bz2 |
tar -xjf - --strip-components=1 tar -xjf - --strip-components=1
mysql --verbose --execute="CREATE DATABASE ${USER}_nextcloud" mysql --verbose --execute="CREATE DATABASE ${USER}_nextcloud"
echo "Installing Nextcloud" echo "Installing Nextcloud"
@@ -32,7 +32,6 @@ function install_nextcloud
--database-pass "${MYSQL_PASSWORD}" \ --database-pass "${MYSQL_PASSWORD}" \
--data-dir "${HOME}/nextcloud_data" --data-dir "${HOME}/nextcloud_data"
php ~/html/occ config:system:set trusted_domains 0 --value="$trusted_domain" php ~/html/occ config:system:set trusted_domains 0 --value="$trusted_domain"
php ~/html/occ config:system:set overwrite.cli.url --value="https://$trusted_domain" php ~/html/occ config:system:set overwrite.cli.url --value="https://$trusted_domain"
@@ -66,6 +65,29 @@ function install_nextcloud
printf "You can now access your Nextcloud by directing you Browser to: \n https://%s \n" "$trusted_domain" printf "You can now access your Nextcloud by directing you Browser to: \n https://%s \n" "$trusted_domain"
} }
function process_parameters
{
while test $# -gt 0
do
local next_parameter=$1
case $next_parameter in
use )
shift
VERSION="$1"
shift
;;
esac
done
}
function get_version_name
{
if [[ -n $VERSION ]]
then echo "nextcloud-$VERSION"; exit 0
else echo "latest"; exit 0
fi
}
function setup_domains function setup_domains
{ {
echo "You currently have configured the following domains:" echo "You currently have configured the following domains:"
@@ -230,9 +252,17 @@ function unset_critical_section { set +o pipefail +o errexit; }
function main function main
{ {
set_critical_section set_critical_section
process_parameters "$@"
echo "This script installs the latest release of Nextcloud" if [[ -n $VERSION ]]
echo "and assumes a newly created Uberspace with default settings." then
echo "This script installs Nextcloud $VERSION"
echo "We recommend to use the latest release."
## This feature is mainly used to install older versions and then test the update script.
else
echo "This script installs the latest release of Nextcloud"
echo "and assumes a newly created Uberspace with default settings."
fi
echo "Do not run this script if you already use your Uberspace for other apps!" echo "Do not run this script if you already use your Uberspace for other apps!"
if yes-no_question "Do you want to execute this installer for Nextcloud?" if yes-no_question "Do you want to execute this installer for Nextcloud?"