Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornachoparker <nacho@ownyourbits.com>2021-07-24 22:54:31 +0300
committernachoparker <nacho@ownyourbits.com>2021-07-25 23:59:07 +0300
commit665ed28ae6e84f154bff10916e1636244fc88f9b (patch)
tree7e1cb75c38ebb87a4c8d8f211a612a442deb4ade /install.sh
parenteffdd6cdb3057a60457d71c4bd3d4298d76f2d65 (diff)
build: trap and curl installer fixes
Signed-off-by: nachoparker <nacho@ownyourbits.com>
Diffstat (limited to 'install.sh')
-rw-r--r--install.sh19
1 files changed, 9 insertions, 10 deletions
diff --git a/install.sh b/install.sh
index 12bd6311..f157cdba 100644
--- a/install.sh
+++ b/install.sh
@@ -9,7 +9,7 @@
#
# more details at https://ownyourbits.com
-BRANCH=master
+BRANCH="${BRANCH:-master}"
#DBG=x
set -e$DBG
@@ -30,13 +30,10 @@ type mysqld &>/dev/null && echo ">>> WARNING: existing mysqld configuration wil
# get install code
echo "Getting build code..."
apt-get update
-apt-get install --no-install-recommends -y wget ca-certificates sudo lsb-release
+apt-get install --no-install-recommends -y git ca-certificates sudo lsb-release
-pushd "$TMPDIR"
-wget -qO- --content-disposition https://github.com/nextcloud/nextcloudpi/archive/"$BRANCH"/latest.tar.gz \
- | tar -xz \
- || exit 1
-cd - && cd "$TMPDIR"/nextcloudpi-"$BRANCH"
+git clone -b "${BRANCH}" https://github.com/nextcloud/nextcloudpi.git "${TMPDIR}"/nextcloudpi
+cd "${TMPDIR}"/nextcloudpi
# install NCP
echo -e "\nInstalling NextCloudPi..."
@@ -49,6 +46,8 @@ check_distro etc/ncp.cfg || {
exit 1;
}
+# indicate that this will be an image build
+touch /.ncp-image
mkdir -p /usr/local/etc/ncp-config.d/
cp 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
install_app ncp.sh
run_app_unsafe bin/ncp/CONFIG/nc-init.sh
bash /usr/local/bin/ncp-provisioning.sh
+rm /.ncp-image
-popd
+cd -
+rm -rf "${TMPDIR}"
IFACE="$( ip r | grep "default via" | awk '{ print $5 }' | head -1 )"
IP="$( 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
the warning if you have a (sub)domain available.
"
-exit 0
-
# License
#
# This script is free software; you can redistribute it and/or modify it