diff options
author | Thomas Kaiser <github@kaiser-edv.de> | 2018-05-09 14:09:28 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2018-05-09 14:09:28 +0300 |
commit | 2dcc66c254fb361bb5f67b7e89855d8ae9876f1e (patch) | |
tree | 5579ad267326dd8d63cbf27ab77757bbf86918ec /install.sh | |
parent | 272fe72fbfe53775cdb57f88d77accf415611939 (diff) |
Improve tempdir handling (#499)
Diffstat (limited to 'install.sh')
-rw-r--r-- | install.sh | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -14,7 +14,8 @@ BRANCH=master set -e$DBG -TMPDIR=/tmp/nextcloudplus +TMPDIR="$(mktemp -d /tmp/nextcloudplus.XXXXXX || (echo "Failed to create temp dir. Exiting" >&2 ; exit 1) )" +trap "rm -rf \"${TMPDIR}\" ; exit 0" 0 1 2 3 15 [[ ${EUID} -ne 0 ]] && { printf "Must be run as root. Try 'sudo $0'\n" @@ -36,7 +37,7 @@ echo "Getting build code..." apt-get update apt-get install --no-install-recommends -y wget ca-certificates sudo -rm -rf "$TMPDIR" && mkdir "$TMPDIR" && cd "$TMPDIR" +pushd "$TMPDIR" wget -O- --content-disposition https://github.com/nextcloud/nextcloudpi/archive/"$BRANCH"/latest.tar.gz \ | tar -xz \ || exit 1 @@ -56,9 +57,7 @@ activate_script etc/ncp-config.d/nc-init.sh [[ "$APACHE_EXISTS" != "" ]] && \ a2enmod status reqtimeout env autoindex access_compat auth_basic authn_file authn_core alias access_compat -cd - -rm -rf $TMPDIR - +popd echo "Done. Type 'sudo ncp-config' to configure NCP, or access ncp-web on https://<this_ip>:4443 |