diff --git a/bin/ncp-update-nc b/bin/ncp-update-nc index 2bec0aa5e..50f6379bf 100755 --- a/bin/ncp-update-nc +++ b/bin/ncp-update-nc @@ -234,6 +234,9 @@ fi rm -rf /var/www/nextcloud/apps/previewgenerator ln -snf "${NCPREV}" /var/www/nextcloud/apps/previewgenerator +# refresh completions +ncc _completion -g --shell-type bash -p ncc | sed 's|/var/www/nextcloud/occ|ncc|g' > /usr/share/bash-completion/completions/ncp + # done #################### mkdir -p "$DATADIR"/ncp-update-backups diff --git a/bin/ncp/CONFIG/nc-init.sh b/bin/ncp/CONFIG/nc-init.sh index 9acfdbb30..0df7c3c84 100644 --- a/bin/ncp/CONFIG/nc-init.sh +++ b/bin/ncp/CONFIG/nc-init.sh @@ -181,6 +181,12 @@ EOF ncc config:system:set overwrite.cli.url --value="https://nextcloudpi/" ncc config:system:set trusted_domains "${TRUSTED_DOMAINS[nc_domain]}" --value="nextcloudpi" + # bash completion for ncc + apt_install bash-completion + ncc _completion -g --shell-type bash -p ncc | sed 's|/var/www/nextcloud/occ|ncc|g' > /usr/share/bash-completion/completions/ncp + echo ". /etc/bash_completion" >> /etc/bash.bashrc + echo ". /usr/share/bash-completion/completions/ncp" >> /etc/bash.bashrc + # TODO temporary workaround for https://github.com/nextcloud/server/pull/13358 ncc -n db:convert-filecache-bigint ncc db:add-missing-indices diff --git a/changelog.md b/changelog.md index 7e60de1fa..ce52e0418 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,7 @@ -[v1.39.16](https://github.com/nextcloud/nextcloudpi/commit/e6ebc3d) (2021-09-27) nc-https: proto logic was inverted fix +[v1.39.17](https://github.com/nextcloud/nextcloudpi/commit/520f062) (2021-09-29) add bash completion to ncc + +[v1.39.16](https://github.com/nextcloud/nextcloudpi/commit/2be666b) (2021-09-27) nc-https: proto logic was inverted fix [v1.39.15](https://github.com/nextcloud/nextcloudpi/commit/b067844) (2021-09-27) add get_ip function diff --git a/ncp.sh b/ncp.sh index 8fff524de..26bc0fe41 100644 --- a/ncp.sh +++ b/ncp.sh @@ -34,7 +34,7 @@ install() # add the ncc shortcut cat > /usr/local/bin/ncc <<'EOF' #!/bin/bash -sudo -u www-data php /var/www/nextcloud/occ "$@" +sudo -E -u www-data php /var/www/nextcloud/occ "$@" EOF chmod +x /usr/local/bin/ncc diff --git a/updates/1.40.0.sh b/updates/1.40.0.sh index 139934ed3..2741ab7bb 100644 --- a/updates/1.40.0.sh +++ b/updates/1.40.0.sh @@ -36,6 +36,19 @@ EOF # fix issue with reverse proxy infinite redirections run_app nc-httpsonly +# bash completion for `ncc` +if ! [[ -f /usr/share/bash-completion/completions/ncp ]]; then + apt_install bash-completion + ncc _completion -g --shell-type bash -p ncc | sed 's|/var/www/nextcloud/occ|ncc|g' > /usr/share/bash-completion/completions/ncp + echo ". /etc/bash_completion" >> /etc/bash.bashrc + echo ". /usr/share/bash-completion/completions/ncp" >> /etc/bash.bashrc + cat > /usr/local/bin/ncc <<'EOF' +#!/bin/bash +sudo -E -u www-data php /var/www/nextcloud/occ "$@" +EOF + chmod +x /usr/local/bin/ncc +fi + # docker images only [[ -f /.docker-image ]] && { :