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
path: root/bin
diff options
context:
space:
mode:
authorTobias K <6317548+theCalcaholic@users.noreply.github.com>2022-07-25 23:08:45 +0300
committerTobias K <6317548+theCalcaholic@users.noreply.github.com>2022-07-25 23:08:45 +0300
commitfcd2f47270385f8337e9e726a17ed4d711d22ce5 (patch)
tree96f4cd9f1e712ad4335fe51b4ee19b6a8e934f5d /bin
parent7058939176bb1395781925840698555ce7284c85 (diff)
nc-datadir.sh, nc-encrypt.sh: Avoid set -u in scriptsv1.48.3
Diffstat (limited to 'bin')
-rw-r--r--bin/ncp/CONFIG/nc-datadir.sh2
-rw-r--r--bin/ncp/SECURITY/nc-encrypt.sh24
2 files changed, 13 insertions, 13 deletions
diff --git a/bin/ncp/CONFIG/nc-datadir.sh b/bin/ncp/CONFIG/nc-datadir.sh
index 2503fce7..d8f4f699 100644
--- a/bin/ncp/CONFIG/nc-datadir.sh
+++ b/bin/ncp/CONFIG/nc-datadir.sh
@@ -22,7 +22,7 @@ install()
configure()
{
- set -eu -o pipefail
+ set -e -o pipefail
shopt -s dotglob # includes dot files
## CHECKS
diff --git a/bin/ncp/SECURITY/nc-encrypt.sh b/bin/ncp/SECURITY/nc-encrypt.sh
index 33f8dea3..862a5ee0 100644
--- a/bin/ncp/SECURITY/nc-encrypt.sh
+++ b/bin/ncp/SECURITY/nc-encrypt.sh
@@ -21,15 +21,15 @@ install()
configure()
{
(
- set -eu -o pipefail
+ set -e -o pipefail
local datadir parentdir encdir tmpdir
datadir="$(get_ncpcfg datadir)"
- [[ "${datadir}" == "null" ]] && datadir=/var/www/nextcloud/data
+ [[ "${datadir?}" == "null" ]] && datadir=/var/www/nextcloud/data
parentdir="$(dirname "${datadir}")"
- encdir="${parentdir}/ncdata_enc"
+ encdir="${parentdir?}/ncdata_enc"
tmpdir="$(mktemp -u -p "${parentdir}" -t nc-data-crypt.XXXXXX))"
- [[ "${ACTIVE}" != "yes" ]] && {
+ [[ "${ACTIVE?}" != "yes" ]] && {
if ! is_active; then
echo "Data not currently encrypted"
return 0
@@ -37,14 +37,14 @@ configure()
save_maintenance_mode
trap restore_maintenance_mode EXIT
echo "Decrypting data..."
- mkdir "${tmpdir}"
+ mkdir "${tmpdir?}"
chown www-data: "${tmpdir}"
pkill tail # prevents from umounting in docker
- mv "${datadir}"/* "${datadir}"/.[!.]* "${tmpdir}"
+ mv "${datadir?}"/* "${datadir}"/.[!.]* "${tmpdir}"
fusermount -u "${datadir}"
rmdir "${datadir}"
mv "${tmpdir}" "${datadir}"
- rm "${encdir}"/gocryptfs.*
+ rm "${encdir?}"/gocryptfs.*
rmdir "${encdir}"
echo "Data no longer encrypted"
return
@@ -56,8 +56,8 @@ configure()
fi
# Just mount already encrypted data
- if [[ -f "${encdir}"/gocryptfs.conf ]]; then
- echo "${PASSWORD}" | gocryptfs -allow_other -q "${encdir}" "${datadir}" 2>&1 | sed /^Switch/d
+ if [[ -f "${encdir?}"/gocryptfs.conf ]]; then
+ echo "${PASSWORD?}" | gocryptfs -allow_other -q "${encdir}" "${datadir}" 2>&1 | sed /^Switch/d
# switch to the regular virtual hosts after we decrypt, so we can access NC and ncp-web
a2ensite ncp nextcloud
@@ -67,12 +67,12 @@ configure()
echo "Encrypted data now accessible"
return
fi
- mkdir -p "${encdir}"
- echo "${PASSWORD}" | gocryptfs -init -q "${encdir}"
+ mkdir -p "${encdir?}"
+ echo "${PASSWORD?}" | gocryptfs -init -q "${encdir}"
save_maintenance_mode
trap restore_maintenance_mode EXIT
- mv "${datadir}" "${tmpdir}"
+ mv "${datadir?}" "${tmpdir?}"
mkdir "${datadir}"
echo "${PASSWORD}" | gocryptfs -allow_other -q "${encdir}" "${datadir}" 2>&1 | sed /^Switch/d