99#
1010# more details at https://ownyourbits.com
1111
12- BRANCH=master
13- # DBG=x
12+ BRANCH=" ${BRANCH :- master} "
13+ DBG=x
1414
1515set -e$DBG
1616
@@ -30,13 +30,10 @@ type mysqld &>/dev/null && echo ">>> WARNING: existing mysqld configuration wil
3030# get install code
3131echo " Getting build code..."
3232apt-get update
33- apt-get install --no-install-recommends -y wget ca-certificates sudo lsb-release
33+ apt-get install --no-install-recommends -y git ca-certificates sudo lsb-release
3434
35- pushd " $TMPDIR "
36- wget -qO- --content-disposition https://github.com/nextcloud/nextcloudpi/archive/" $BRANCH " /latest.tar.gz \
37- | tar -xz \
38- || exit 1
39- cd - && cd " $TMPDIR " /nextcloudpi-" $BRANCH "
35+ git clone -b " ${BRANCH} " https://github.com/nextcloud/nextcloudpi.git " ${TMPDIR} " /nextcloudpi
36+ cd " ${TMPDIR} " /nextcloudpi
4037
4138# install NCP
4239echo -e " \nInstalling NextCloudPi..."
@@ -49,6 +46,8 @@ check_distro etc/ncp.cfg || {
4946 exit 1;
5047}
5148
49+ # indicate that this will be an image build
50+ touch /.ncp-image
5251
5352mkdir -p /usr/local/etc/ncp-config.d/
5453cp etc/ncp-config.d/nc-nextcloud.cfg /usr/local/etc/ncp-config.d/
@@ -62,8 +61,10 @@ systemctl restart mysqld # TODO this shouldn't be necessary, but somehow it's ne
6261install_app ncp.sh
6362run_app_unsafe bin/ncp/CONFIG/nc-init.sh
6463bash /usr/local/bin/ncp-provisioning.sh
64+ rm /.ncp-image
6565
66- popd
66+ cd -
67+ rm -rf " ${TMPDIR} "
6768
6869IFACE=" $( ip r | grep " default via" | awk ' { print $5 }' | head -1 ) "
6970IP=" $( ip a show dev " $IFACE " | grep global | grep -oP ' \d{1,3}(.\d{1,3}){3}' | head -1 ) "
@@ -79,8 +80,6 @@ first load the activation and :4443 pages. You can run letsencrypt to get rid of
7980the warning if you have a (sub)domain available.
8081"
8182
82- exit 0
83-
8483# License
8584#
8685# This script is free software; you can redistribute it and/or modify it
0 commit comments