diff --git a/configure.sh b/configure.sh index 8d39b99..e7a4232 100755 --- a/configure.sh +++ b/configure.sh @@ -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() { @@ -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