Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ checks() {
if ! which php >/dev/null 2>&1; then
fail "Error: php is required"
fi

if ! which jq >/dev/null 2>&1; then
fail "Error: jq is required"
fi
}

config_server() {
Expand Down Expand Up @@ -95,17 +91,15 @@ add_config_partials() {
main() {
checks

# Redirecting jq's stderr to drop parser error message that we can test for it
local status="$( ooc status --output json 2>/dev/null | jq '.installed' 2>/dev/null )"
local status="$( ooc status 2>/dev/null | grep 'installed: ' | sed -r 's/^.*installed: (.+)$/\1/' )"

if [ "${status}" = "" ]; then
# Parse validation
if [ "${status}" != "true" ] && [ "${status}" != false ]; then
echo "Error testing Nextcloud status. This is the output of occ status:"
ooc status
exit 1
fi

if [ "${status}" != "true" ]; then
echo "NextCloud is not installed, abort"
elif [ "${status}" != "true" ]; then
echo "Nextcloud is not installed, abort"
exit 1
fi

Expand Down